Source Code My Simple Terminal Caculator Using Python

Source Code For My Terminal Calculator

def add():
    print("Addition:")
    print()
    a = int(input("Enter the Number of A : "))
    b = int(input("Enter the Number of B : "))
    print()
    print("Total :",a+b)

def sub():
    print("Subtraction:")
    print()
    a = int(input("Enter the Number of A : "))
    b = int(input("Enter the Number of B : "))
    print()
    print("Difference :",a-b)

def mul():
    print("Multiplication:")
    print()
    a = int(input("Enter the Number of A : "))
    b = int(input("Enter the Number of B : "))
    print()
    print("Product :",a*b)

def div():
    print("Division:")
    print()
    a = int(input("Enter the Dividend : "))
    b = int(input("Enter the Divisor : "))
    print()
    print("Quotient :",a/b)
    print("Remainder :",a%b)

def exitto():
    print()
    print("Maths Caculator Exited !")
    quit()
    
print()    
print("Welcome to Maths Caculator")
print()
name = input("Enter Your Name : ")
while True:
    print()
    print("Hello",name)
    print("""
1.Addition
2.Subtraction
3.Multiplication
4.Division
5.To Quit
""")
    ch = int(input("Enter the Choice : "))
    if ch == 1:
        print()
        add()
    elif ch == 2:
        print()
        sub()
    elif ch == 3:
        print()
        mul()
    elif ch == 4:
        print()
        div()
    elif ch == 5:
        exitto()
    else:
        print()
        print("Incorrect Choice ...")
    

Comments

Popular posts from this blog

The best widgets on Windows 11