# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3 (ipykernel)
#     language: python
#     name: python3
# ---

# +
import math
print("\n\n\n\t\t\t\t*****************Calculator******************\n\n\n")

print("\n What do you want : ")
print("\t1. Addition,press 1")
print("\t2. Substraction,press 2")
print("\t3. Multiplication,press 3")
print("\t4. Division,press 4")
print("\t5. Exponent,press 5")
print("\t6. Remainder,press 6")
print("\t7. Logarithm,press 7")

ch = 'n'

while ch=='n':

    n = int(input("\n\n\tEnter Your Choice : "))

    if n<=3:
        num1 = int(input("\n\tEnter First Number : "))
        num2 = int(input("\n\tEnter Second Number : "))
        if n==1:
            res = num1+num2
            print("\n\tThe Addition of",num1,"&",num2,"is",res)
        elif n==2:
            res = num1-num2
            print("\n\tThe Substraction of",num1,"&",num2,"is",res)
        else :
            res = num1*num2
            print("\n\tThe Multiplication of",num1,"&",num2,"is",res)

    elif n==4 or n==6:
        num1 = int(input("\n\tEnter the value of Dividend : "))
        num2 = int(input("\n\tEnter the value of Divisor : "))
        if n==4:
            res = num1/num2
            print("\n\tThe Result of",num1,"divided by",num2,"is",res)
        else :
            res = num1%num2
            print("\n\tThe Remainder of",num1,"divided by",num2,"is",res)

    elif n==5 or n==7 :
        num1 = int(input("\n\tEnter The Base Value : "))
        num2 = int(input("\n\tEnter The power/number : "))
        if n==5:
            res = num1**num2
            print("\n\tThe Result of",num2,"power to the",num1,"is",res)
        else :
            res = math.log(num2,num1)
            print("\n\tThe Logarithm of",num2,"base to the",num1,"is",res)

    else :
        print("\n\tError !! You Entered Wrong Choice")
    
    ch = input("\n\tDo you want to EXIT [y/n]: ")
    if ch=='y':
        print("\n\n\t\t\t\t*****************EXIT*****************")

StarcoderdataJupyterScriptsDedupFiltered