American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

6:30pm – Intro to Python – Roland

May 28 @ 6:30 pm - 7:30 pm

Today We Did

  1. Quiz 2

Homework:

If you did not complete the homework below for last class, please finish it by next class.

Make a new file called May21_QuizPracticeHW and complete question 4 found at https://www.ayclogic.com/intro-to-python/star-wars-problem/ (also pasted below)

  1. Create a function with return value, “movie_ticket_price”. The function need to have one parameter “age“. Inside the function, when age is less than 4, return 0. When age is less than 10 return 5. When age is less than 59 return 10. Otherwise return 7. Outside the function, ask user in the shell “How old are you: ” take user input and call the above function and use the user input as the function parameter. Print the function return value like this “Your ticket price is $<return value>”. Look at expected output below if you run your program 3 times with different input.
    1. How old are you: 7
      Your ticket price is $5
      
      How old are you: 3
      Your ticket price is $0
      
      How old are you: 100
      Your ticket price is $7

If you have any questions, feel free to email me at rolandyang@ayclogic.com

Details

Date:
May 28
Time:
6:30 pm - 7:30 pm
Verified by MonsterInsights