Lecture 11/17/2026

This commit is contained in:
Edward Bigos 2026-11-17 12:30:27 -05:00
commit bf3265103a
44 changed files with 1195 additions and 3 deletions

View file

@ -0,0 +1,12 @@
# Program to print the sum of first 5 natural numbers
# https://beginnersbook.com/2018/01/python-for-loop/
# variable to store the sum
sum = 0
# iterating over natural numbers using range()
for val in range(1, 6):
# calculating sum
sum = sum + val
# displaying sum of first 5 natural numbers
print(sum)