Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 944e85f

Browse files
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
Lines changed: 11 additions & 0 deletions
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)
Lines changed: 8 additions & 0 deletions
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)))
Lines changed: 12 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /