pycharm-1

Python

1.4解释器(运行文件)

1.5注释:#单行,ctrl+/

多行注释       ””” 

”””

2.1变量

assert,except;lambda; nonlocal;

2.2数据类型(type()函数可返回数据类型)

数值(int,float)

布尔(Ture,False)

字符串(str)

列表(list)

元组(tuple)

集合(set)

 

字(dict)

输入输出

# ---格式化输出--- #%s:         

字符串   %d:(%u:无符号) 

有符号的十进制整数   %f    

浮点数%00d:不足以零补全,

print("%02d%f" % (age, c))   按顺序

# f ‘{表达式}’   print( f '今年是{age}' )

print("输出内容", end="\n"# python 中默认为"\n"
print('he', end='\t')

input("提示信息”),接受input有变量,接受的数据类型是字符串

 

数据类型转换

 

Int()  Float()  Str(),tuple()

应用:a = int(input('a = '))


#

猜你喜欢

转载自www.cnblogs.com/kekefu/p/12235470.html