Print Friendly and PDF
#My first program in Python. 

start = True 

while start:
    print("1 = Addition")
    print("2 = Subtraction")
    print("3 = Multiplication")
    print("4 = Division")
    print("5 = Exit program")
    zubi = int(input("Enter number : "))
    if zubi == 1:
        print("Addition")
        first = int(input("Enter first number :"))
        secund = int(input("Enter secund number :"))
        result = first + secund
        print(first ,'+' ,secund ,'=' , result)
    elif zubi == 2:
        print("Subtraction")
        first = int(input("Enter first number :"))
        secund = int(input("Enter secund number :"))
        result = first - secund
        print(first ,"-" ,secund ,"=" , result)
    elif zubi == 3:
        print("Mmltiplication")
        first = int(input("Enter first number :"))
        secund = int(input("Enter secund number :"))
        result = first * secund
        print(first ,"*" ,secund ,"=" , result)
    elif zubi== 4:
        print("Division")
        first = int(input("Enter first number :"))
        secund = int(input("Enter secund number :"))
        result = first / secund
        print(first ,"/" ,secund ,"=" , result)
    elif zubi == 5:
        print("exit!")
        start = False
zubairsaif

Zubair saif

A passionate writer who loves to write on new technology and programming

Post A Comment:

0 comments: