【问题标题】:loop questions Python循环问题 Python
【发布时间】:2017-11-07 16:08:06
【问题描述】:

我需要询问用户有多少人预订,最多 8 人,然后取该金额并询问用户 1 的详细信息、用户 2 的详细信息等。保存详细信息以便稍后打印。不知道我很python新手。

manager_name = raw_input("please enter managers Name: ")
email_address = raw_input("please enter your Email Address: ")
phone_number = raw_input("please enter your Phone number: ")



print("-----------------------------------------------------")
print ("Our Stuido can Accommodate up to max 8 musicians")
print("-----------------------------------------------------")

amount_of_band_members = int(raw_input("please enter the amount of band members"))

values = []
for i in range(amount_of_band_members):
values.append(int(input('Please enter Muscians Names & Insterments: ')))

【问题讨论】:

  • 缩进很重要

标签: python loops


【解决方案1】:
manager_name = raw_input("please enter managers Name: ")
email_address = raw_input("please enter your Email Address: ")
phone_number = raw_input("please enter your Phone number: ")


print("-----------------------------------------------------")
print ("Our Stuido can Accommodate up to max 8 musicians")
print("-----------------------------------------------------")

amount_of_band_members = int(raw_input("please enter the amount of band members"))

if amount_of_band_members >8:
    print ("Sorry we can only Accommodate maxuim 8 Musicians")
else :
    print raw_input("please enter musicians and insterments")


while amount_of_band_members <8:
    print raw_input("please enter next name")
    amount_of_band_members +=1

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-26
    • 2014-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多