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!
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
Mathew V L2,910 Points
Confused on function
For this function here. What does "number_of_ticket" represent? It's no where in the while loop so how would it know what number_of_tickets even is? While loop only has num_tickets
def calculate_price(number_of_tickets): #Create a new constant for the 2 dollar service charge #Add service charge to what is due return (number_of_tickets * TICKET_PRICE) + SERVICE_CHARGE
Xavier BassCourses Plus Student 2,246 Points
number_of_tickets is the parameter of the function for when you call the function and pass in an argument ...so number_of_tickes is what you put in like ...calculate_price(5) (five = number_of_tickes... basically its a placeholder )