- Fork the following repository.
- Make sure Python and VSCode are set on your device. You can use the references below.
- You will open the code ov VSCode and write the code in
main.py. - Run the code to test it.
- Create a dictionary called
person, it has three properties,namewhich is a string,agewhich is an integer,hobbieswhich is a list of strings. - Create a function called
change_agewhich takes thepersondictionary and anumberas arguments, this function changes the age in the dictionary to thenumber. The return value of this function is the updated dictionary. - Create a function called
add_hobbywhich takes thepersondictionary and ahobbyas arguments. This function adds the hobby to the list ofhobbiesinside the person dictionary. The function will return the updated dictionary.
- Create a function called
add_jobwhich takes ajobwhich is a string, as an argument. This function checks, if the dictionary does not have a property calledjobthen it will add it to the dictionary. The function will return the updated dictionary. - Create a function called
check_hobbies, which takes a person dictionary as an argument. This function checks the number of hobbies for this person, if it's more than three hobbies, print to the user a message telling them that they're talented.