首页 > 代码库 > ex14

ex14

 1 # -*-coding:utf-8 -*-
 2 from sys import argv
 3 
 4 script, user_name, city = argv
 5 rompt = ">>"      #巧妙的提示符的运用 取一个变量名就ok了
 6 
 7 print ("Hi %s, I‘m the %s script." %(user_name, script))
 8 print ("I‘d like to ask you a few questions.")
 9 print ("DO you like me %s?" % user_name)
10 likes = input(rompt)
11 
12 print ("where do you live in  %s?" % city)
13 lives = input(rompt)
14 
15 print ("what kind of computer do you have?")
16 computer = input(rompt)
17 
18 print ("""
19 Alright, so you said %s about liking me.
20 You live in %s. Not sure where that is.
21 And you have a %s computer. Nice.
22 """ %(likes, lives, computer))

 

ex14