Exercises
Exercise 1
If you did the exercise duplicate
you already have a function named has_duplicates
that takes a list as a parameter and returns True
if there is any object that appears more than once in the list.
Use a set to write a faster, simpler version of has_duplicates
.
Exercise 2: rotate-pairs
Two words are "rotate pairs" if you can rotate one of them and get the other (see rotate_word
). Write a program that reads a wordlist and finds all the rotate pairs.
Last updated