Question: I need help fixing my code: the # 4 looping is where I am struggling. When put into IDLE, the code prints out this: r

I need help fixing my code:
the #4looping is where I am struggling. When put into IDLE, the code prints out this:
r is Pokemon #7 I caught!
i is Pokemon #6 I caught!
a is Pokemon #5 I caught!
f is Pokemon #4 I caught!
e is Pokemon #3 I caught!
l is Pokemon #2 I caught!
C is Pokemon #1 I caught!
I am trying to have it print out the names of all 15 pokemon starting with the last one like so:
Clefairy is Pokemon #15 that I caught!
Sandshrew is Pokemon #14 that I caught!
etc...
#1creating a tuple with the names of 15 pokemon
Pokemon=('Pikachu', 'Charmander', 'Caterpie', 'Bulbasaur', 'Squirtle', 'Eevee',
'Vulpix', 'Ponyta', 'Arcanine', 'Weedle', 'Pidgey', 'Rattata', 'Ekans',
'Sandshrew', 'Clefairy')
#4looping in reverse order using format method
for i in range(len(Pokemon)-1,-1,-1):
print('{} is Pokemon #{} I caught!'.format(Pokemon[i],i+1))

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!