Skip to content

Instantly share code, notes, and snippets.

@raeq
Last active April 30, 2020 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raeq/0f06117df1b0c1608095778085032098 to your computer and use it in GitHub Desktop.
Save raeq/0f06117df1b0c1608095778085032098 to your computer and use it in GitHub Desktop.
capitals = {"London", "New York", "Kuala-Lumpur", "Den Haag", "Bern", "Peking"}
for city in capitals:
if city.find(' ') > 0:
print(f"This city's name is comprised of more than one word: {city}")
elif city.find('-') > 0:
print(f"This city's name is comprised of more than one word: {city}")
else:
print(f"This city's name is just one word: {city}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment