Skip to content

Commit ffa41e3

Browse files
committed
section2 commit
1 parent 480f590 commit ffa41e3

File tree

25 files changed

+134
-0
lines changed

25 files changed

+134
-0
lines changed

Section2/.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section2/.idea/Section2.iml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section2/.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section2/.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section2/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Section2/lecture21/Program1.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("Hello World")

Section2/lecture21/__init__.py

Whitespace-only changes.

Section2/lecture22/Program1.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Program to print greeting message
2+
def greet(name):
3+
print("Python greetings: Hello ",name)
4+
n = input("Enter your Name \n")
5+
greet(n)

Section2/lecture22/Program2.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Program to find sum and average of n numbers
2+
n = total = int(input("Enter the limit \n"))
3+
sum = 0
4+
while n>0:
5+
sum = sum + int(input("Enter number \n"))
6+
n = n - 1
7+
print("Sum of Numbers : ", sum)
8+
print("Average of Numbers : ", sum/total)
9+
10+
11+

Section2/lecture22/Program3.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Program to print factorial of a given number
2+
def factorial(n):
3+
if n <= 0:
4+
return 1
5+
else:
6+
return n*factorial(n-1)
7+
num = int(input("Enter the Number \n"))
8+
print(" Factorial of ", num," is ", factorial(num))

0 commit comments

Comments
 (0)