python program to print the sum of first 10 natural numbers using for loop

preview_player
Показать описание
This video tells you how to write a python program to print the sum of first 10 natural numbers using the for loop.

It makes you understand the working of the program thoroughly by going through each iteration of the loop step by step and keeping a tab of variable values in a table.
Рекомендации по теме
Комментарии
Автор

sum=0
for x in range (0, 11)
print(x)
sum=sum+x
print(sum)
OUTPUT
55

prathampal
Автор

print ()
What is the use of this in the second last line?

nivedyasachin
Автор

INPUT
for i in range(1, 10):
print(i, end=' ')

OUTPUT
1 2 3 4 5 6 7 8 9

guruinstitute
Автор

for i in range(1, 10): print(i)

1 2 3 4 5 6 7 8 9 10

Pacifist_Roamimg