首页 > Linux操作系统 > Linux操作系统 > Python 语法基础
#整型 integer_number = 90 #浮点 float_number = 90.4 #复数 complex_number = 10 + 10j #list 序列 sample_list = [1,2,3,'abc'] #dictionary 字典 sample_dic = {"key":value, 2:3} #tuple 只读的序列 sample_tuple = (1,3,"ab")
flag1 = some_value flag2 = other_value if flag1: do_function_1() elif flag2: do_function_2() else: do_function_3()
for i in range(0, 10): print(i) for i in ['a','b','c','dd','eee']; print(i)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/86824/viewspace-671499/ ,如需转载,请注明出处,否则将追究法律责任。