Here is my code ( my problem is that the value is not displaying but instead its displaying the code that i wrote for my output instead)
#This program will calculate your total amount of a meal purchased at a restaurant
OriginalCost = float(input(' what was your total amount of the meal purchased at the restaurant?'))
Tip = .18
TipC = (Tip * OriginalCost)
Tax = .07
TaxC = (Tax * OriginalCost)
Totalamount = (OriginalCost + TipC + TaxC)
print('your original cost is', "OriginalCost")
print('The tip is', "TipC")
print('The tax is', "TaxC")
print('The total cost is', "Totalamount")
#π My program is to calculate the amount of a meal purchased at a restaurant
37 messages Β· Page 1 of 1 (latest)
@wooden saddle
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
you're combining strings btw, which is what causes the error ```py
this
print("hello", "world")
is the same as
print("hello world")```
not if using variables
#This program will calculate your total amount of a meal purchased at a restaurant
OriginalCost = float(input(' what was your total amount of the meal purchased at the restaurant?'))
Tip = .18
TipC = (Tip * OriginalCost)
Tax = .07
TaxC = (Tax * OriginalCost)
Totalamount = (OriginalCost + TipC + TaxC)
print('your original cost is', "OriginalCost")
print('The tip is', "TipC")
print('The tax is', "TaxC")
print('The total cost is', "Totalamount")
ohhh i see
what did it output?
the output is still the same it wont give me the value for some reason
it gives me this output The tip is TipC
The tax is TaxC
The total cost is Totalamount
okay will do
did it work?
it did give me a value
the correct one?
let me adjust it with the other as well
okay
you welcome
since im new to coding what was the error i was making?
a string is a list of characters and is declared by putting double quotes or single quotes
since you want to use a variable there's no need for ""
oh okay so what i understand then that any variable assigned does not need quotes around it?
exactly
okay i really appreciate it man i hope you have a good day
that is all i do have another assigntment for later that i wil attempt to do if im really hard stuck on something i will make another discussion post but for now that is all
good luck
thank you
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.