Let me start over with the code. I added the print(cities) in the code, to show that the response is the same as @lisalisaj.
# Checkpoint 1 & 2
addresses = ["221 B Baker St.", "42 Wallaby Way", "12 Grimmauld Place", "742 Evergreen Terrace", "1600 Pennsylvania Ave", "10 Downing St."]
addresses.sort()
print(addresses)
# Checkpoint 3
names = ["Ron", "Hermione", "Harry", "Albus", "Sirius"]
names.sort()
# Checkpoint 4 & 5
cities = ["London", "Paris", "Rome", "Los Angeles", "New York"]
cities.sort(reverse=True)
print(cities)
sorted_cities = cities.sort()
print(sorted_cities)
>>>
Output:
['10 Downing St.', '12 Grimmauld Place', '1600 Pennsylvania Ave', '221 B Baker St.', '42 Wallaby Way', '742 Evergreen Terrace']
['Rome', 'Paris', 'New York', 'Los Angeles', 'London']
None
As you can see, the printed result from the cities is reversed, as it is intended by the description of the 5th instruction
" Edit the .sort()
call on cities
such that it sorts the cities in reverse order (descending).
Print cities
to see the result."
But, i get the error “Value for ['Rome', 'Paris', 'New York', 'Los Angeles', 'London']
did not match the expected value.”.
If i add the sort reverse in the sorted_cities, then it accepted it as correct. See code below:
# Checkpoint 1 & 2
addresses = ["221 B Baker St.", "42 Wallaby Way", "12 Grimmauld Place", "742 Evergreen Terrace", "1600 Pennsylvania Ave", "10 Downing St."]
addresses.sort()
print(addresses)
# Checkpoint 3
names = ["Ron", "Hermione", "Harry", "Albus", "Sirius"]
names.sort()
# Checkpoint 4 & 5
cities = ["London", "Paris", "Rome", "Los Angeles", "New York"]
cities.sort(reverse=True)
print(cities)
sorted_cities = cities.sort(reverse=True)
print(sorted_cities)
>>>
Output:
['10 Downing St.', '12 Grimmauld Place', '1600 Pennsylvania Ave', '221 B Baker St.', '42 Wallaby Way', '742 Evergreen Terrace']
['Rome', 'Paris', 'New York', 'Los Angeles', 'London']
None
I hope it is more clear now.