192k views
5 votes
How are Python dictionaries different from Python lists? Python lists can store strings and dictionaries can only store words Python dictionaries are a collection and lists are not a collection Python lists are indexed using integers and dictionaries can use strings as indexes

User Sherard
by
4.7k points

2 Answers

3 votes

Answer:

The Python dictionary is an in-built function that people can use by calling in the 'import' keyword. A list is something that the user can import using square brackets, for example:

list_name = [0,0,0,0,0]

User Athlonshi
by
5.5k points
3 votes

Answer:

Python lists are indexed using integers and dictionaries can use strings as indexes

Step-by-step explanation:

Python lists can store strings and dictionaries can only store words False

Words are actually strings. This is false because Python dictionaries store strings.

Python dictionaries are a collection and lists are not a collection False

This is false because in Python lists are an ordered collection of items

Python lists are indexed using integers and dictionaries can use strings as indexes True

Python lists are an ordered collection of items. Indexing means referring to the position of the element and this is possible using integer for Python lists and strings for Python dictionaries.

User Haxwithaxe
by
4.1k points