在Python shell中打印 helloworld!只需print(“hello world!”) ?
IDIE里编程的步骤
"File->New File"打开文件编辑窗口输入代码
“File->Save”保存文件
“Run->Run Module”运行,查看结果
举个栗子 ?
给自己点份饮料
import random
menu=["coffee","tea","cola","milk","water"]
print("Menu:",menu)
name=input("Your name please:")
drink=random.choice(menu)
print("hello",name,"!Enjoy your",drink)
解释input
在python3.x中raw_input( )和input( )进行了整合,去除了raw_input( ),仅保留了input( )函数,其接收任意任性输入,将所有输入默认为字符串处理,并返回字符串类型。