colors = ["red", "green", "blue", "violet", "yellow", "orange", "purple"]
print colors # prints list as above
colors.sort()
print colors # prints sorted list
sorted_colors = colors.sort()
print sorted_colors # prints None
print colors.sort() # prints None
Wow, just wow. Counter-intuitive. Not the way my brain works.
No comments:
Post a Comment