python day2(2021.4.22)

python的关键字:

['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 

'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if',

'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return',

'try', 'while', 'with', 'yield']

 

python的程序执行顺序是自上而下,因此一个python脚本执行的入口不是非必须的!!

 

print函数

print函数的结尾符 end=''(可以省略)

print('你好',end='')
print('我是凉天’)

输出结果:两个语句在同一行,end=''的作用相当于取消了换行

 

input函数:接收输入数据,返回string类型

name=input('你的姓名是:')

 

posted @ 2021-04-22 22:32  凉天  阅读(47)  评论(0)    收藏  举报