Answered step by step
Verified Expert Solution
Question
1 Approved Answer
given _ items = [ one , two, 3 , 4 , five, [ six , seven, eight ] ] #Write
givenitems one "two", "five", six "seven", "eight"
#Write a program that iterates through the items in the
#given list. For each item, you should attempt to iterate
#through the item and print each character seperately.
#
#If this second part fails, print "Not iterable" but
#even if the second part fails, you should still go on
#to the next item in the list.
#
#Hint: Although we'll cover lists more in Unit all
#you need to know right now is that this syntax will run
#a loop over a list, a string, or any other iterable
#type of information:
#
# for item in givenitems:
#
#To iterate over the items in 'item', you can do the
#same thing: for subitem in item:
#
#Start out by building the nested foreach loops that
#you'll need. Then, identify where the error is
#occurring to figure out where to put the tryexcept
#structure.
#
#This one's tricky, but you can do it
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started