Multi-Parameter Functions - Introduction to Python: Absolute Beginner Module 2 Video 5

Published: 06 August 2021
on channel: Book Simplifiers
128
2

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)


On this page of the site you can watch the video online Multi-Parameter Functions - Introduction to Python: Absolute Beginner Module 2 Video 5 with a duration of hours minute second in good quality, which was uploaded by the user Book Simplifiers 06 August 2021, share the link with friends and acquaintances, this video has already been watched 128 times on youtube and it was liked by 2 viewers. Enjoy your viewing!