目的:如何让让用户读取用户输入
读取用户输入
name = input("what is your name?")
print("hello" + name )
执行脚本后就会发现,程序会等待你输入姓名后再往下继续走
可以让用户输入多个信息,如下
name = input("what is your name?") age = input("how old are you?") hometown = input("where is your hometown") print("hello", name ,"you are ", age,"you came from",hometown)
代码注释原则:
1.不用全部加注释,只需要在自己觉得重要或者不好理解的部分加注释即可
2.注释可以用英文或者中文,但绝对不要用拼音