I will just kind of recreate it for you since there are some errors in it.
There it is worked out but I will explain it to you too.
To the right, there are comments on what it does as well if you need them.
I have changed your names to just normal letters for ease of use.
Asking The Questions:
I took the A and made it Equal to the input statement. In the input statement, I asked the user for how many tickets they would like for a child. and after they answer it goes to the next question and asks them how adult tickets they would like.
Doing The Math:
First I made their answers into an integer turning them into a number so we can add and multiply them. I made
X equal to the amount per child ticket so that you can change the amount if you need to. I then made
Z the amount per adult for the same reason as before. Now we do some actual math. I took the number and multiplied them using
, so I did C is equal to A times () X, and now C is the answer to it. then I do the same thing for the children’s tickets. I then added them together for a total.
E is equal to
C plus
D making E the variable for it.
IF statement:
In the IF statement, it says that if the number is
greater than 50 then
subtract 10 from it using
e -= 10 and then print out the receipt
ELSE statement:
Under the else statement, it just is the printed-out version of the receipt. Instead of subtracting we just give them the receipt.
Important Notes:
You must make sure you put a
: (Dubble dot) after you have an IF or ELSE statement.
You must have a TAB line under the IF and an ELSE statement.
If you have a
: (Dubble dot) after you have an IF or ELSE statement it will TAB for you.
My code link:
https://replit.com/@Chandler0Bing/testeraa#main.py
You can copy and paste it if you would like to.
Extra Stuff:
This took me a while but I hope it helps you out. Also welcome to replit ask
@elvines.