Concept: Multi-Parameter Functions
Functions with multiple parameters
Functions can have multiple parameters separated by commas
Example
review and run the code
def make_schedule(period1, period2):
schedule = ("[1st] " + period1.title() + ", [2nd] " + period2.title())
return schedule
student_schedule = make_schedule("mathematics", "history")
print("SCHEDULE:", student_schedule)
Task 2
Define make_schedule() adding a 3rd period to
Start with the above example code
add a parameter period_3
update function code to add period_3 to the schedule
call student_schedule() with an additional argument such as 'science'
print the schedule
[ ] add a 3rd period parameter to make_schedule
[ ] Optional - print a schedule for 6 classes (Tip: perhaps let the function make this easy)
На этой странице сайта вы можете посмотреть видео онлайн Multi-Parameter Functions - Introduction to Python: Absolute Beginner Module 2 Video 5 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Book Simplifiers 06 Август 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 128 раз и оно понравилось 2 зрителям. Приятного просмотра!