Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed all the issues in the codes #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addition.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
num2 = int(input("Enter second number: "))

# addition
result = num1 * num2
result = num1 + num2

print("The sum of", num1, "and", num2, "is", result)
10 changes: 8 additions & 2 deletions gcd.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
def gcd(a, b):
if(b == 0):
return a
else:
return gcd(b, a % b)

num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))

# greatest common divisor
result = num1 + num2

print("The GCD of", num1, "and", num2, "is", result)

print("The GCD of", num1, "and", num2, "is", gcd(num1,num2))
2 changes: 1 addition & 1 deletion simple_interest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
time = float(input("Enter the number of years for the investment: "))

# Simple Interest Calculation
interest = (principal * rate * time)
interest = (principal * rate * time)/100

print("The simple interest for an investment of", principal, "at", rate, "% for", time, "years is:", interest)