Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

What are the functions of top management?

Answered: 1 week ago

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago