exercise14 提示 传递
script, user_name = argv
prompt = '> '  
#加一个提示
print "Hi %s, I'm the %s script." % (user_name, script)
print "I'd like to ask you a few questions."
print "Do you like me %s?" % user_name
likes = raw_input(prompt)
print "Where do you live %s?" % user_name
lives = raw_input(prompt)
print "What kind of computer do you have?"
computer = raw_input(prompt)
print """
Alright, so you said %r about liking me.
You live in %r.  Not sure where that is.
And you have a %r computer.  Nice.
""" % (likes, lives, computer)


$ python ex14.py zed
Hi zed, I'm the ex14.py script.
I'd like to ask you a few questions.
Do you like me zed?
>  Yes
Where do you live zed?
>  San Francisco
What kind of computer do you have?
>  Tandy 1000

Alright, so you said 'Yes' about liking me.
You live in 'San Francisco'. Not sure where that is.
And you have a 'Tandy 1000' computer. Nice.
阅读更多
想对作者说点什么? 我来说一句

exercise14

栈帧

zn_wuxunian zn_wuxunian

2018-05-10 20:12:30

阅读数:9

飞秋/feiq软件下载

2010年03月06日 3.02MB 下载

局域网文件传递 文件传递

2009年07月29日 168KB 下载

没有更多推荐了,返回首页

不良信息举报

exercise14 提示 传递

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭