Démonstration de Python Range ()
# welcome to softhunt.net
# Python Program to
# show range() basics
# printing a number
print('Numbers: ')
for i in range(15):
print(i, end=" ")
print()
# using range for iteration
print('using range for iteration: ')
l = [5, 10, 15, 20, 25]
for i in range(len(l)):
print(l[i], end=" ")
print()
# performing sum of natural
# number
sum = 0
for i in range(1, 16):
sum = sum + i
print("Sum of first 15 natural number :", sum)
Outrageous Ostrich