Which of these are correctly formatted Python dictionaries? Check all that apply. dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’: ‘ABC School’}; dict = (‘Name’: ‘Mary’, ‘Age’: 13, ‘School’: ‘XYZ School’) dict = [“Programming Basics”, “Introduction to Python”] dict = {‘season’: ‘fall’, ‘weather’: ‘cool’}; dict = ’[‘laptop’, ‘computer’, ‘hard drive’]

Respuesta :

Answer:

A. dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’: ‘ABC School’}

Explanation:

Since python does not use type when declaring a variable, you must make sure you make your variables correctly or else it won't compile correctly. Lists use braces[]; Strings use quotes, "" or ''; Integers are just declared with a number(s); Dictionaries use brackets{} and inside are attributes of something. For instance, you can use dictionaries to describe ages, {'"Bryan": 6, "Alex": 13, etc.} Sort of like a json file. Dictionaries also tend to use uppercase letters when describing something. The only answer that has all the attributes correct is A. dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’: ‘ABC School’}

hope i helped :D

Answer:

The answer is A dict = {‘Name’: ‘Matthew’, ‘Age’: 14, ‘School’: ‘ABC School’}; and dict = {‘season’: ‘fall’, ‘weather’: ‘cool’};. I hoper this helps. Have a great day.

Explanation:

I just did the assignment on ed and got them right.

Have a great day.

ACCESS MORE