Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What type of data structure is a list in Python?
Think about whether you can change its content after it's created.
How would you access the first element of a list named fruits?
Remember that indexing starts at zero in Python.
Which of the following is true about lists in Python?
Think about whether you can change a list after you've created it.
Strings can be modified in Python.
Consider the property of strings as immutable.
Create a list of 5 favorite cities, change one city to a new one, and then print the modified list.
Think about how to use indexing to access and change the list.
Given a string, 'computer', create a new string that has the first and last character swapped.
Use string slicing to rearrange characters.
6 more questions in this section. Enroll free to practise them all.
Enroll free