Skip to content

Instantly share code, notes, and snippets.

@cibofdevs
Last active September 19, 2022 12:44
Show Gist options
  • Save cibofdevs/caed7c7a55ba1a797b179a27d4f4cd89 to your computer and use it in GitHub Desktop.
Save cibofdevs/caed7c7a55ba1a797b179a27d4f4cd89 to your computer and use it in GitHub Desktop.
# Write one for loop to print out each element of the list several_things.
# Then, write another for loop to print out the TYPE of each element of the list several_things.
# To complete this problem you should have written two different for loops,
# each of which iterates over the list several_things, but each of those 2 for loops should have a different result.
several_things = ["hello", 2, 4, 6.0, 7.5, 234352354, "the end", "", 99]
for i in range(len(several_things)):
print(several_things[i])
for j in range(len(several_things)):
print(type(several_things[j]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment