0% found this document useful (0 votes)
35 views4 pages

Numeric Calculator

This document is a Python script that implements a simple calculator allowing users to perform various mathematical operations such as addition, subtraction, multiplication, and more. It prompts the user to select an operation and input numbers, then calculates and displays the result. The script includes functions for trigonometric calculations, exponentiation, logarithms, factorials, and powers.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views4 pages

Numeric Calculator

This document is a Python script that implements a simple calculator allowing users to perform various mathematical operations such as addition, subtraction, multiplication, and more. It prompts the user to select an operation and input numbers, then calculates and displays the result. The script includes functions for trigonometric calculations, exponentiation, logarithms, factorials, and powers.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import math

print("Welcome")

print("Press 1 for Addition ")

print("Press 2 for Subtraction ")

print("Press 3 for Multiplication ")

print("Press 4 for Division ")

print("Press 5 for Sine ")

print("Press 6 for cosine ")

print("Press 7 for Tangent ")

print("Press 8 for Exponential ")

print("Press 9 for 2 to the power")

print("Press 10 for Logarthmic ")

print("Press 11 for Factorial ")

print("Press 12 for Square ")

print("Press 13 for Cube ")

n=int(input("Enter your number :"))

if (n==1):

a=int(input("Enter your number 1 :"))

b=int(input("Enter your number 2 :"))

c=a+b

print("Addition of ",a,"and",b,"is",c)
elif (n==2):

a=int(input("Enter your number 1 :"))

b=int(input("Enter your number 2 :"))

c=a-b

print("Subtraction of ",a,"and",b,"is",c)

elif (n==3):

a=int(input("Enter your number 1 :"))

b=int(input("Enter your number 2 :"))

c=a*b

print("Multiplicaion of ",a,"and",b,"is",c)

elif (n==4):

a=int(input("Enter your number 1 :"))

b=int(input("Enter your number 2 :"))

c=a/b

print("Division of ",a,"and",b,"is",c)

elif (n==5):

a=int(input("Enter your number :"))

b=[Link]

print("Sine of ",a,"is",b)

elif (n==6):

a=int(input("Enter your number :"))


b=[Link]

print("Cosine of ",a,"is",b)

elif (n==7):

a=int(input("Enter your number :"))

b=[Link]

print("Tan of ",a,"is",b)

elif (n==8):

a=int(input("Enter your number :"))

b=math.e

print("Exponential of ",a,"is",b)

elif (n==9):

a=int(input("Enter your number :"))

b=2**a

print("2 to the powwer of ",a,"is",b)

elif (n==10):

a=int(input("Enter your number :"))

b=[Link]

print("Log of ",a,"is",b)

elif (n==11):

a=int(input("Enter your number :"))


b=[Link]

print("Factorial of ",a,"is",b)

elif (n==12):

a=int(input("Enter your number :"))

b=a*a

print("Square of ",a,"is",b)

elif (n==13):

a=int(input("Enter your number :"))

b=a*a*a

print("Cube of ",a,"is",b)

else :

print("Wrong Choice")

You might also like