0
What am I doing wrong here?
I wanted to make a list and and pick certain numbers within the list to show in Ordinal numbers (4th, 2nd, etc) and the rest to be just numbers, how can I skip a number to be printed twice with this code? li = list(range()) for i in li: if i == 1: print('1st') print(i) It prints 1st and 1, I want it to print 1st and the rest of the list.
2 Respostas
+ 1
King you havn't provided arguments for range() function
as per you need
add the continue statement under the print("1st") inside if bock.
0
Ratnapal Shende Thank you, that's is exactly what I was looking for.
Jan Markus thank you, I learnt something new, now I don't have to type 1st, 2nd till eternity.