Question: Question 4 ( Looping through a list ) : ( 1 0 ) One of the useful technique of python list is the ability to

Question 4(Looping through a list): (10)
One of the useful technique of python list is the ability to loop through it (i.e it is iterable ). Using loops, we can access the individual elements of the list. What we do with these elements is really up to our creativity. Following questions familiarize you with some of the useful technique you can apply through loops and if - else statements.
a. Create a list with names of four animals (Assign the list to variable name Animals. Can you loop through Animals and print each element?)
b. Can you print the name of each animal by adding an extra s at the end? (Hint: You would have to loop though each elements and modify it before printing the result )
For example;
Animals =[Cat,Horse,Dog,Elephant]
Cats
Horses
Dogs
Elephants

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!