- This event has passed.
8 PM – Python OOP – Joel
November 17 @ 8:00 pm - 9:00 pm
Today we did:
- We started working on the MonsterSystem
Homework:
- Make a new file called Nov17_Exercises and do the following:
- Make a new dictionary called student that stores the name as a key and the age as the value. The names and ages are up to you, but make 3 items.
- For example, in mine: {19:John, 40:Will, 31:Alice}
- Take Will from the dictionary and print it.
- Change “Will” with “Emma”
- Add a new item (35:Daniel)
- Delete John from the dictionary.
- Make 3 for loops: One looping through just the keys, one through just the values, and one for both the keys and the values.
- Make a new function called format_name. It has two parameters: first_name and last_name. It takes the first_name and last_name, combines them in one string (you can call it full_name), and then returns it.
- Make a new function called print_greeting(). It calls format_name() with a first and last name and prints “Welcome, <full name>!”.
If you have any questions, feel free to email me at joel@ayclogic.com.