# encoding: utf-8
import sys #导入标准包from test.test_compare import Cmpa = 3
b = 4c = 5.66d = 8.0e = complex(c,d)
f = complex(float(a),float(b))print ('a is type', type(a))print ("c is type",type(c))print ("e is type",type(e))print ("f is type",type(f))print(a+b)
print(b/c)print(c/d)print(c*e)print(b//a)print(d//a)print(sys.float_info)print("what is your name \ntom") #哈换行
print("你好") #打印中文字符print(len([1,2,3,12])) #打印长度为有几个元组
abcd_list = ['a--','b--','c--','d--']
print(abcd_list[0])print(abcd_list[1])print(abcd_list[2])print(abcd_list[3])print(abcd_list[-2]) #打印负向第2个print(abcd_list[2:]) #打印正向从2开始后的所有的的元组 number_list = [1 ,3 ,5 ,7]string_list = ['abc' , 'cde' ,'123' ,'java']hunhe_list = ['小明' ,'12K' ,'12']print(len(string_list+hunhe_list+number_list)) #打印以上三种列表类型里共有几个元素print('number_list最大值是:'+ str(max(number_list))) #返回nmber_list 最大值print(min(number_list)) #返回nmber_list 最小值print(' 重复打印四次 ' * 4)print("小明" in [1,2,3,4,"小明"]) #判断 小明 是否在这个列表里面 print('number_list is:' + str(number_list))print("string_list is:" + str(string_list))print("hunhe_list is:" + str(hunhe_list))test1 = number_list[1]
test2 = number_list[3]test3 = string_list[1]test4 = hunhe_list[0]print('{0},{1},{2},{3}'.format(test1,test2,test3,test4)) #利用format 格式打印出各类型列表的值number_list[1]=30 #修改数字列表序号为1的值为30
print (str(number_list[1]))del number_list[2] #删除数字列表里的第2个字符
print ('number_list after del '+ str(number_list)) #打印数字列表