Skip to content

Commit 944e85f

Browse files
authored
Merge pull request #3 from 96RadhikaJadhav/Added-basic-python-programs
Added basic python programs
2 parents 7bff512 + 7cd30a8 commit 944e85f

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

Diff for: Beginner_Level_Python_programs/compound_interest.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def compound_interest(principle, rate, time):
2+
3+
# Calculates compound interest
4+
Amount = principle * (pow((1 + rate / 100), time))
5+
CI = Amount - principle
6+
print('The principal is', principle)
7+
print('The time period is', rate)
8+
print('The rate of interest is',time)
9+
print("Compound interest is", CI)
10+
11+
compound_interest(10000, 10.25, 5)

Diff for: Beginner_Level_Python_programs/factorial.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def factorial(n):
2+
3+
return 1 if (n==1 or n==0) else n * factorial(n - 1)
4+
5+
6+
num=input("Please enter number to calculate factorial:")
7+
8+
print ("Factorial of",num,"is",factorial(int(num)))

Diff for: Beginner_Level_Python_programs/simple_interest.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def simple_interest(principle,time,rate):
2+
print('The principal is', principle)
3+
print('The time period is', time)
4+
print('The rate of interest is',rate)
5+
6+
si = (principal * time * rate)/100
7+
8+
print('The Simple Interest is', si)
9+
return si
10+
11+
12+
simple_interest(8, 6, 8)

0 commit comments

Comments
 (0)