Skip to content

Instantly share code, notes, and snippets.

@ashutoshpipriye
Created May 27, 2020 09:59
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 ashutoshpipriye/acab47361fb9146fc6e750cd3b07bd11 to your computer and use it in GitHub Desktop.
Save ashutoshpipriye/acab47361fb9146fc6e750cd3b07bd11 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