- 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,name
which is a string,age
which is an integer,hobbies
which is a list of strings. - Create a function called
change_age
which takes theperson
dictionary and anumber
as 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_hobby
which takes theperson
dictionary and ahobby
as arguments. This function adds the hobby to the list ofhobbies
inside the person dictionary. The function will return the updated dictionary.
- Create a function called
add_job
which takes ajob
which is a string, as an argument. This function checks, if the dictionary does not have a property calledjob
then 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.