Mithu ka Calculator

Calculator:-


def square():
while True:

number1=int(input("Enter a Number: "))
print("The Square of number is: ",number1*number1)
break

def sqaureroot():
import math
while True:
number1 = int(input("Enter a Number: "))
print("The Square of number is: ", math.sqrt(number1))
break


while True:
print("This Calculator can be calculate such as ")
print('''
1.Addition
2.Subtraction
3.Multiplication
4.Divide
5.Square
6.Square Root
''')
choice=int(input("Choose Opreation..(1,2,3,4,5,6): "))
if choice==1:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("The Sum of number is: ",num1 + num2)

elif choice==2:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("The Subtraction of number is: ", num1 - num2)

elif choice==3:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("The Subtraction of number is: ", num1 * num2)

elif choice==4:
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("The Subtraction of number is: ", num1 / num2)

elif choice==5:
square()
elif choice==6:
sqaureroot()

else:
print("Invailed Opreation")

ans = input("Due you want to more calculation, if you want then type(Y/N): ")
if ans == 'n':
print("Good Bye!")
break




 

Comments

Popular posts from this blog

Become Healthy Goal - Python Program

Calculator in C++

Interpretation vs Compilation