input( ) input()函数:让程序运行暂停,等待用户输入. message = input('Tell me something, and I will repeat it back to you: ') print(message) 运行结果: Tell me something, and I will repeat it back to you: Hello Python!Hello Python! 1. 编写清晰的程序 name = input("Please enter you…
Python编程从入门到实践笔记——用户输入和while循环 #coding=utf-8 #函数input()让程序暂停运行,等待用户输入一些文本.得到用户的输入以后将其存储在一个变量中,方便后续使用 name=input("Please Enter Your Name:") print("Hello!"+name+"!Welcome to Python world!") prompt = "If you tell us who you…
Python编程从入门到实践笔记——操作列表 #coding=utf-8 magicians = ['alice','david','carolina'] #遍历整个列表 for magician in magicians : print(magician) print("hello everyone!") #for循环(冒号和缩进) for number in range(1,6): print(number) #用range()创建数字列表 #list().range()前闭后开…