Hello everyone, hope you all are fit and fine.
⚠️⚠️⚠️If you are unable to copy the code, then copy whole page.
Source Code:
#Calculator
def calculator():
print("\n Welcome to the Calculator:\n Programmed by Coder_of_Paradise")
operation = input('''
Type of operations can be hold in this calculator
+ for addition
- for substraction
* for multiplication
/ for division
** for power
Enter your choice ;
''')
num1 = int(input("Enter your first number : "))
num2 = int(input("Enter your second number : "))
if operation == '+':
print(f"{num1}+{num2}={num1+num2}")
elif operation == '-':
print(f"{num1}+{num2}={num1-num2}")
elif operation == '*':
print(f"{num1}*{num2}={num1*num2}")
elif operation == '/':
print(f"{num1}/{num2}={num1/num2}")
elif operation == '**':
print(f"{num1}**{num2}={num1**num2}")
#you can edit more functions from your side
else:
print('''You press a wrong key.
please try again....
''')
again()
def again():
restart = input('''
Do you want to calculate again?
Please press y for Yes or n for No
''')
if restart == 'y':
calculator()
elif restart == 'n':
print("See you soon")
else:
again()
calculator()
Thank you,all.
Comments
Post a Comment