Question: Which of the following code blocks will print both keys and values? Group of answer choices dict 1 = { } dict 1 [ '

Which of the following code blocks will print both keys and values?
Group of answer choices
dict1={}
dict1['number']=10
dict1['color']= 'Red'
dict1['word']= 'Chair'
for values in dict1:
print(values)
dict1={'number': 10, 'color': 'Red', 'word': 'Chair'}
for keys, values in dict1.items():
print(dict1[keys], values)
dict1= dict(number =10, color = 'Red', word = 'Chair')
for keys, values in dict1.items():
print(keys, values)
dict1={'number': 10, 'color': 'Red', 'word': 'Chair'}
for keys, values in dict1:
print(keys, dict1[keys])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!