age = int(raw_input("Please input your age:")) if age > 50: print "you are old, need to retire. " elif age > 30: print "You are in the middle age !" elif age > 18: print "You are adult!" else: print "too young!"...
Python2/3中的输入函数input()、raw_input() Python中的标准输入函数 Python提供了内置的函数从标准输入读入一行文本,默认的标准输入是键盘。这里的内置函数指的是Python2中的input()、raw_input()函数和Pyhont3中的input()函数 Python2中的input()函数输入数字不会报错并且保存为数字;直接输入字符会报错,要以引号...
题目在Python中,用于获取用户输入的函数 A. raw< underline> _ < /underline>input() B. read< underline> _ < /underline>input. C. get< underline> _ < /underline>input() D. input()11 12 相关知识点: 试题来源: 解析 D 反馈 收藏
百度试题 结果1 题目在Python中,如何获取用户输入? A. 使用input()函数 B. 使用print()函数 C. 使用sys.stdin.readline() D. 使用raw_input()函数 相关知识点: 试题来源: 解析 A 反馈 收藏
python中交互输入函数raw_input 用户输入年龄,打印输出 age = int(raw_input("Please input your age:")) if age > 50: print "you are old, need to retire. " elif age > 30: print "You are in the middle age !" elif age > 18: