- 帖子
- 6
- 精华
- 0
- 积分
- 69
- 阅读权限
- 20
- 注册时间
- 2013-11-6
- 最后登录
- 2015-2-1
|
本帖最后由 hunsjie 于 2013-11-6 15:16 编辑
https://learn-python-the-hard-way-zh_cn-translation.readthedocs.org/en/latest/ex13.html
加分题:raw_input 和 argv 一起使用,让你的脚本从用户手上得到更多的输入
不知我对题目的理解有没有错,除了这种方法外,有无其他方法?
黑体是我做的,运行代码也没错。
我自己写的程序如下:
from sys import argv
script, first, second, third = argv
first = raw_input("> ")
second = raw_input("> ")
third = raw_input("> ")
print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third
|
|