Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions python CLI Calculator
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
print("\nWelcome to This Calculator, Developed By Swarup :)\n")
print("Please Choose Your Calculation type, and enter type (ex + - *)")
print("\n Enter + for Addition \n Enter - for subtraction \n Enter / for division \n Enter * for multiplication \n")
choice = input("Please Enter Your Choice ->> ")
print("\n")
num1 = int(input("Please enter the 1st number - "))
num2 = int(input("Please enter the 2nd number - "))
print("\n")
if choice == "+":
num4 = num1 + num2
print(" Your answer is = " + str(num4))
elif choice == "-":
num4 = num1 - num2
print(" Your answer is = " + str(num4))
elif choice == "/":
num4 = num1 / num2
print(" Your answer is = " + str(num4))
elif choice == "*":
num4 = num1 * num2
print(" Your answer is = " + str(num4))
else:
print("\n Out of range/ Error \n")
print("Thank you for using our deshi calculator ;) visit again.")