- 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?
4 Respostas
0
For loops are meant for iteration(i.e through lists)
x=[25,46,26]
for i in x:
print(i)
- 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)
- 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)
- 1
It's not an iterable, so, you can't