how do I get a Python for loop/if statement to do the opposite? Namely, I would like the loop below, just adding an additional statement in the third row (between the if statement and the print statement, without changing the first, second and fourth row) to print a, p, p, e.
for i in "apple":
if i == "l":
# additional statement here
print(i)
Can you please let me know? Thank you very much
Aucun commentaire:
Enregistrer un commentaire