笨办法学python 习题14 优化过 遇到问题的请看

时间:2024-01-12 20:08:26

print "\t what's you name?"
user_name = raw_input('>')

from sys import argv
script, = argv

prompt = '>'

print "\t hi %s,I'm the %s script"%(user_name,script)
print "\t I'd like to ask you a few questions"

print "\t Do you like me %s"%(user_name)
likes = raw_input(prompt)

print "\twhere do you live %s?"%(user_name)
lives = raw_input(prompt)

print "\twhat kind of computer do you have?"
computer = raw_input(prompt)

print '''
\t Alright,you say '%r' about liking me.
\t you live in '%r'.Not sure where that is.
\t And you have a '%r' computer. Nice!
''' %(likes,lives,computer)