1、print函数:输出函数,将内容格式化的去显示在控制台窗口
>>> a=1
>>> b=2
>>> c=3
>>> print(abc)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'abc' is not defined
>>> print(a,b,c)
1 2 3
2、sep:多个数据之间的间隔默认是一个空格’ ’
>>> print(1,2,3,sep = '!')
1!2!3
3、end:结尾默认"\n"
>>> print(1,2,3,sep='#',end='哈哈')
1#2#3哈哈>>> print(1,2,3,sep='#',end='哈哈\n')
1#2#3哈哈
4、input函数:获取用户的输入数据,输入的数据是一个字符串
>>> a = input("请输入你的年龄:")
请输入你的年龄:12
>>> a + 1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can only concatenate str (not "int") to str
#多个数据的输入
>>> a,b,c = input("请输入三个数字:")
请输入三个数字:12,13,14
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: too many values to unpack (expected 3)
>>> input("请输入三个数字:")
请输入三个数字:1,2,3
'1,2,3'
5、eval函数:解析字符串中的数字,整数,小数,其他进制的整数
>>> eval("3")
3
>>> eval("3.14")
3.14
>>> eval("WYZ")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<str