I've got the following list
ninjas = ['ryu', 'crystal', 'yoshi', 'ken']
I'm playing around with loops and have the following for loop
for ninja in ninjas:
if ninja == 'ryu':
print(f'{ninja} - black belt')
if ninja == 'ken':
print(f'{ninja} - brown belt')
else:
print(ninja)
The output I want is
ryu - black belt
crystal
yoshi
ken - brown belt
but the output I get is
ryu - black belt
ryu
crystal
yoshi
ken - brown belt
I'm assuming that after the first if statement it is looping back around to the start, hence the repeated 'ryu', how do I stop it doing that?
Thanks in advance