Answered step by step
Verified Expert Solution
Question
1 Approved Answer
help plaese 4. Add 2 inches to the son's height. In ( 1: dict={son's name: Lucas, son's eyes: green, son's height: 32, son's weight: 25)
help plaese
4. Add 2 inches to the son's height. In ( 1: dict={"son's name": "Lucas", "son's eyes": "green", "son's height": 32, "son's weight": 25) #Type your answer below. print (dict) 5. Using Items method generate a list of tuples consisted of each key value pair. In 1: dict={"son's name" : "Lucas", "son's eyes": "green", "son's height": 32,"son's weight": 25) #Type your answer below. ans_1- print (ans_1) 6. Using get() method print the value of "son's eyes" In 1: dict = {"son's name": "Lucas", "son's eye color": "green", "son's height": 32,"son's weight": 25) #Type your answer inside the print. ans_1= print (ans_1) en and nothing con 7. get method can be used just to get the value of a key. But it has more tricks up its sleeve. Try to look for key 'son's age and it nothing comes up make the.get) return "2". In 1: dict={"son's name" : "Lucas", "son's eye color": "green", "son's height": 32,"son's weight": 25) #Type your answer here. ans_1- print(ans_1) 8. Since dictionaries are mutable, they have some methods that tuples don't have clear is one of them and it clear the whole dictionary In 1: dict={"son's name" : "Lucas", "son's eye color": "green", "son's height": 3, "son's weight": 25) #clear the dictionary here then print it. print(dict) 9. Using len function, find how many keys there are in the dictionary In 1: dict={"son's name": "Lucas", "son's eye color": "green", "son's height": 3, "son's weight": 25) Write your answer here. ans_1 print(ans 1) 10. What's the key with the highest value in the dictionary? In [ 1: dict={"son's name":"Lucas", "son's eye color": "green", "son's height": 32,"son's weight": 25) #Write your answer here. ans_1 print(ans_1) 11. What's the key with the lowest value in the dictionary? In : dict={"son's name": "Lucas", "son's eye color": "green", "son's height": 32, "son's weight": 25) Write your answer here. ans_1 print(ans_11 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started