Python - Print numbers from 1-10 using for loop
Python - Print numbers from 1-10 using for loop
CODE
def writeNumbers():
#For loop to print numbers from 1-10.
#Here the max number in the range should be the ending number +1
#So the below code will not print from 1-11 but from 1-10
for i in range(1, 11):
print(i)
writeNumbers()
#OUTPUT
#1
#2
#3
#4
#5
#6
#7
#8
#9
#10
Comments
Post a Comment