vendredi 30 avril 2021

How would you print number 1,2,3,4,5,6,7,8,18,19,20,21,22,23,24 in python?

I had knowledge about java so I tried writing an if block within the for block saying,

for i in range(25):
    if i == 9:
        i = 18
    print(i)

This code logic works in java but not in python. What should I do?

Aucun commentaire:

Enregistrer un commentaire