- This event has passed.
1 PM – Intro to Python
October 24, 2020 @ 1:00 pm - 2:00 pm
- Congrats on finishing your final project!
- Today we started Baby Name Generator.
- You homework is to create a function “print_random_names”. This function will take two parameter “names” which is a list of names, and “num_names” which is the number of times to print out a random name from the “names” list. Here’s what the function should look like:
def print_random_names(names, num_names): # you need to finish this function! # This function should print out a random name from "names" # num_names times.
If you call print_random_names(['bob'], 1), your function should print out bob once. If you call print_random_names(['bob'], 2), it should print out bob twice. Finally if you call print_random_names(['bob', 'james'], 1), it should either print out bob once or james once.