- 1

how to print integer(25) or integers(25,45,36) or float(2.5) or floats(2.5,3.5,6.8) by using python's for loop?

https://code.sololearn.com/c694BJjo0p32/?ref=app

4th Apr 2020, 3:10 PM
HAMZA
4 Réponses
0
For loops are meant for iteration(i.e through lists) x=[25,46,26] for i in x: print(i)
4th Apr 2020, 3:14 PM
Justus
Justus - avatar
- 1
HAMZA if u are asking about how to print integers from a number like 5 to 100 with for loop then, for i in range(5, 101): print(i)
4th Apr 2020, 3:20 PM
maf
maf - avatar
- 1
can i print 25 using for loop.i know i can print it using print(25).but is it possible to print 25 by using for loop. for x in 25: print(x)
4th Apr 2020, 3:28 PM
HAMZA
- 1
It's not an iterable, so, you can't
4th Apr 2020, 3:30 PM
Justus
Justus - avatar