问题描述
#INSTRUCTIONS
#
#在这个程序中,你必须问用户:
#你的名字是什么? br />
#
#然后打印出个性化的问候语。
#一般规则
#
#对于名叫Maria的人,请回复打印:
#Hello Maria :)
#
#对于一个名叫Wally的人,请回复打印:
#Hello Wally :)
#
#...等。
#
#一般情况下,对于名为< name>的人,请通过打印回复:
#Hello< name>
#特别名称
#
#两个人很特别:Amar和Brandy。
#一个名叫Amar或Brandy的人在你打招呼之后应该收到一条额外的评论
#
#对于一个名叫Amar的人,回复者说:
#Hello Amar :)
#我喜欢你的鞋子
#
#对于一个名叫的人白兰地,回应说:
#Hello Brandy :)
#你好像很酷的人
#请注意,如果您的
#打印语句与上面指定的完全匹配,机器人评分员只会标记您的解决方案。
#
#拼写,间距,标点符号......所有这些都很重要。
#
#您的输入声明也很重要。你必须这样说:
#你叫什么名字?
#--- -------------------------------------------------- ---------------
#将你的Python代码放在这里:
我尝试过:
name =输入( 你叫什么名字?)
print ( Hello,name + :))
if name == ' Amar':
print ( 我喜欢你的鞋子)
elif name == ' Brandy':
print ( 你好像很酷)
# INSTRUCTIONS
#
# In this program, you must ask the user:
#"What is your name?"
#
# And then respond by printing out a personalized greeting.
# GENERAL RULE
#
# For a person named Maria, respond by printing:
#Hello Maria :)
#
# For a person named Wally, respond by printing:
#Hello Wally :)
#
# ...etc.
#
# In general, for a person named <name>, respond by printing:
#Hello <name>
# SPECIAL NAMES
#
# Two people are special: Amar and Brandy.
# A person named Amar or Brandy should receive an additional comment after you say hello
#
# For a person named Amar, respond by saying:
#Hello Amar :)
#I like your shoes
#
# For a person named Brandy, respond by saying:
#Hello Brandy :)
#You seem like a cool person
# Note that the robot grader will only mark your solution correct if your
# print statements match EXACTLY what was specified above.
#
#Spelling, spacing, punctuation... all that stuff matters.
#
#Your input statement also matters. You must say it exactly like this:
#What is your name?
# --------------------------------------------------------------------
# Put your Python code here:
What I have tried:
name = input("What is your name? ") print("Hello",name+" :)") if name == 'Amar': print ("I like your shoes") elif name == 'Brandy': print ("You seem like a cool person")
这篇关于我不断收到关于我应该做什么和我实际做了什么的错误信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!