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()前闭后开…
Python编程从入门到实践笔记——变量和简单数据类型 #coding=gbk #变量 message_1 = 'aAa fff' message_2 = 'hart' message_3 = "Albert Einstein once said, “A person who never made a mistake never tried anything new.”" #使用方法修改字符串的大小写 print(message_1.title()) print(message_1.u…
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…