找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 2399|回复: 0

[求助] 我该如何重复运行该程序啊各位大佬们

1

主题

1

帖子

1

积分

贫民

积分
1
TSJDDW 发表于 2022-10-27 00:47:51 | 显示全部楼层 |阅读模式
#if user want yo run again
min_n=int(input("""Please enter minimum number of people:
"""))
max_n=int(input("""Please enter maximum number of people:
"""))
#caculate total cost of maximum number and minimum number
max_cost=25+15*max_n
min_cost=25+15*min_n
          #ask the user whether to enable additional features
e_n=int(input("""Do you want to output all the values? (answer: 1(yes) or 2(no)):
"""))
d=int(input("""Please select currency type 1(USD) or 2(CAN):
"""))
          #only output minimun of number and maximum of number
if e_n>1:
#use CAN
  if d>1:
    print("The total cost can range from $",min_cost,"to $",max_cost,end="")
    print(".")
    #ask user while want to run again
    r=int(input("Want to try again?【answer: 1(yes) or 2(no)】"))
    if r>1:
      a=1
    else :
      print()
  #use USD
  else :
    min_cost=1.36*min_cost
    max_cost=1.36*max_cost
    print("The total cost can range from $",min_cost,"to $",max_cost,end="")
    print(".")
    #ask user while want to run again
    r=int(input("Want to try again?【answer: 1(yes) or 2(no)】"))
    if r>1:
      a=1
    else :
      print()
#output all possible values
else :
  #use CAN
  if d>1:
    max_cost=max_cost+1
    print("The following outputs all possible values")
    ready=str(input("""(Enter any button):
    """))
    print("The following outputs all possible valuesrange:")
    for i in range(min_cost,max_cost):
           print(i)
      #ask user while want to run again
    r=int(input("Want to try again?【answer: 1(yes) or 2(no)】"))
    if r>1:
      a=1
    else :
      print()
  #use USD
  else :
    min_cost=1.36*min_cost
    max_cost=1.36*max_cost
    max_cost=max_cost+1
    print("The following outputs all possible values")
    ready=str(input("""Are you ready?(Enter any button):
    """))
    print("The following outputs all possible valuesrange:")
    for i in range(min_cost,max_cost):
           print(i)
      #ask user while want to run again
    r=int(input("Want to try again?【answer: 1(yes) or 2(no)】"))
    if r>1:
      a=1
    else :
      print()


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表