Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Ryan Canty
2,433 PointsPython programming problem
Hey guys! Im working on a problem and cant figure out how to answer it....
the problem is as follows. "make a python program that calculates tip and total bill for a restaurant. Upon running the program, it asks the user: How much is your original bill? The program takes the original bill amount as an input to calculate tip and total bill. Tip is based on 15% of original bill. It outputs Your tip based on 15% is ______ (fill in tip amount here) Your total bill is ___________ (fill in total bill here)
The program can also take the preferred tip percentage from the user and output both tip percentage, tip amount and total bill. " Any help would be GREATLY appreciated
So far I have
mealAmount = float(input("How much is your original bill?"))
whatTip = float (input("What percentage would you like to tip?"))
tipAmount = mealAmount * whatTip
print("Your tip amount is "
but I dont know how to call my function "tipAmount" in the print function.
[edit formatting -cf]
2 Answers

Kenneth Love
Treehouse Guest TeacherIf you've done Python Basics, we've done two different ways of combining strings or inserting values into strings, so that would handle your current problem.

Andreas cormack
Python Web Development Techdegree Graduate 33,011 PointsHi
As suggested above go over python basics course.
mealAmount = float(input("How much is your original bill?"))
whatTip = float (input("What percentage would you like to tip?"))
tipAmount = mealAmount * (whatTip/100)
print("Your tip amount is ") # here you can use the string's format function to insert values into a string
Chris Freeman
Treehouse Moderator 68,468 PointsChris Freeman
Treehouse Moderator 68,468 PointsWhat have you tried so far? Can you edit your question and add your code?