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)
Nesta página do site você pode assistir ao vídeo on-line Multi-Parameter Functions - Introduction to Python: Absolute Beginner Module 2 Video 5 duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Book Simplifiers 06 Agosto 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 128 vezes e gostou 2 espectadores. Boa visualização!