三个双引号除了注释还有定义多行字符串的功能,并且中间不需要换行\n
https://blog.csdn.net/Dontla/article/details/103476041
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 = input(prompt)
print ("Where do you live %s?" % user_name )
lives = input(prompt)
print ("What kind of computer do you have?" )
computer = 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) )

这游戏感觉没什么意思,有时间不如去玩点3A大作
http://www.yxdown.com/SoftView/SoftView_231080.html
我是一个学python的小白,如果有错误可以评论告诉我,不胜感激。
网友评论