-
-
Notifications
You must be signed in to change notification settings - Fork 118
Calculator for functions of log trigonometry etc Go for it #1367
sdrpspnkr1384
started this conversation in
Ideas
import numpy as nm
print(" Welcome to My Calculator ")
while True:
n = int(input('''
[1] Calculator
[2] Natural log fxn
[3] Trigonometric functions
[4] value of PI
[5] x^2
[6]power function
[7] Exit
'''))
if n==1:
c = eval(input(" enter the value :- "))
d = eval(input ("enter the value:- "))
e = input("choose operation (+ ,- ,*,/):- ")
if e=='+':
k= c+d
print(k)
elif e=='-':
k= c-d
print(k)
elif e=='*':
k=c*d
print(k)
elif e=='/':
k= c/d
print(k)
else:
print("Andha h Kya Laude")
elif n==2:
a= eval(input("enter the value:- "))
if a<=0:
print(" andhe pahle ln function padh")
else:
k=nm.log(a)
print( "ln",a,"=" ,k)
elif n==3:
d = eval(input(" enter the value (Real number):- "))
c = input(" Choose (sine ,cos ,tan ) :- ")
if c =='sine':
k= nm.sin(d)
print(k)
elif c=='cos':
k= nm.cos(d)
print(k)
elif c=='tan':
k= nm.tan(d)
print(k)
else:
print(" Andha h Kya Laude ")
elif n==4:
print(3.14159265359)
elif n ==5:
a = eval(input ("enter the value:- "))
k = pow(a, 2)
print(k)
elif n==6:
a= eval(input("enter the value a :-"))
b= eval(input("enter the value b :-"))
c = input("Choose ( a^b=x , b^a=y):- ")
if c =='x':
k= pow(a, b)
print(k)
elif c== 'y':
k=pow(b, a)
print(k)
else:
print("andha h kya laude ")
elif n==7:
break;
else :
print(" DEKH KAR CHOOSE KAR NA LAUDE ")
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment