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

Jatin Bhardwaj_2310992109_G-24 #15

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
64 changes: 64 additions & 0 deletions Jatin Bhardwaj_2310992109.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
print("**********************************************************************")
print(" :::::::::::::::Calculator:::::::::::::::\n")
print(" ::::Select a number to perform corresponding action:::: ")
print(
" [1] for multiplication \n [2] for division \n [3] for subtraction \n [4] for exponent \n [5] for addition\n [6] for factorial\n "
)


def multiplication(num1, num2):
mul = num1 * num2
print("Multiplication of the two nos. is ::", mul)
def division(num1, num2):
div = num1/num2
print("Division of the two nos. is ::", div)
def subtraction(num1, num2):
sub = num1 - num2
print("Subraction of the two nos. is ::", sub)
def exponent(num1, num2):
expo = num1**num2
print("Exponent of the two nos. is ::", expo)
def addition(num1, num2):
add = num1 + num2
print("Addition of the two nos. is ::", add)
def factorial(num1):
fact = 1
for i in range(1,num1+1):
fact=fact*i
print("Factorial of First Number is=", end=" ")
print(fact)
def factorial2(num2):
fact1 = 1
for j in range(1,num2+1):
fact1=fact1*j
print("Factorial of Second Number is=", end=" ")
print(fact1)





Operation = int(input("Select the number from 1, 2, 3, 4, 5, 6 :: "))

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

if (Operation == 1):
multiplication(num1, num2)

elif (Operation == 2):
division(num1, num2)

elif (Operation == 3):
subtraction(num1, num2)

elif (Operation == 4):
exponent(num1, num2)

elif (Operation == 5):
addition(num1, num2)

else:
factorial(num1)
factorial2(num2)

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This is an experiment based task for me. I am just learning Source Code Mangement. And all changes that I will make is only based on experiments while learing Source Code Mangement. The title of this Project is Calculator which is based on Python. Made by Jatin Bhardwaj 2310992109 of G-24.
Enhanced the interface of the calculator. Addition is also added in the calculator. Made other operations working previously multiplication operation was working.
# Functions have been created such as addition, subtraction, division, exponent.
# Added factorial to make the calculator attractive.
Simply used concept of Functions.