程序交互

目的:如何让让用户读取用户输入

读取用户输入

  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)
View Code

代码注释原则:

1.不用全部加注释,只需要在自己觉得重要或者不好理解的部分加注释即可

2.注释可以用英文或者中文,但绝对不要用拼音

posted @ 2018-08-28 00:10  FlameLuo  阅读(160)  评论(0编辑  收藏  举报