Unit 8
Unit 8
4. If we want to iterate through a list, we can use both for loop and
while loop to accomplish this.
A. True
B. False
5. In order to iterate through a dictionary, we use keys instead of
indexes.
A. True
B. False
Unit 8 Exercise
Create a list containing at least 3 elements. Write a function that
returns the list backwards.
Write a function that takes in one argument as a string. If the reversed
string is the same as the original string (ex: racecar spelled backwards
is still racecar), return True. Otherwise, return False.
Write a function that takes in one string argument and returns the
largest word in the string. If there are two or more words that are the
same length, return the first word from the string with that length.
Ignore punctuations.
Ex) fun&!! Time will return Time
I love dogs will return love