Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math as m
- priceTotal=0
- answer=("y")
- while answer==("y"):
- print("do you want a ticket? (y/n)")
- answer=input()
- if answer==("y"):
- print ("how old are you?")
- age=int(input())
- if age<12:
- price=8
- else:
- price=12
- print("would you like to watch the movie in 3d? (y/n)")
- answer2=input()
- if answer2==("y"):
- price=price+3
- print("what row would you like to sit in?")
- X=int(input())
- if X>5:
- price=price+3
- if age>12:
- print("are you a student or retired? (y/n)")
- answer3=input()
- if answer3==("y"):
- price=(m.floor(0.8*price))
- print("Price per ticket: {}$".format(price))
- satz1=("You just configured a ticket for {}$. You will sit in row {}".format(price,X))
- if answer2==("y"):
- satz2=(", your movie will be in 3D ")
- else:
- satz2=("")
- if answer3==("y"):
- satz3=(", and you are a student or you already retired!")
- else:
- satz3=(".")
- print(satz1+satz2+satz3)
- print("how many of those tickets do you want?")
- amount=input()
- price=(int(amount)*price)
- priceTotal=priceTotal+price
- print ("Total Price: {}$".format(priceTotal))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement