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

Publicado el: 06 agosto 2021
en el canal de: 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)


En esta página del sitio puede ver el video en línea Multi-Parameter Functions - Introduction to Python: Absolute Beginner Module 2 Video 5 de Duración hora minuto segunda en buena calidad , que subió el usuario Book Simplifiers 06 agosto 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 128 veces y le gustó 2 a los espectadores. Disfruta viendo!