Originally published byDev.to
num1 = float(input("enter a number :"))
symb = input("enter (+,-,*,/) :")
num2 = float(input("enter a number :"))
if symb == "+":
print("Answer =",num1+num2)
elif symb == "-":
print("Answer =",num1-num2)
elif symb == "*":
print("Answer =",num1*num2)
elif symb == "/":
if num2 != 0: #not to get an infinite loop as anything divided by zero is not defined
print("Answer =",num1/num2)
else:
print("Not defined as the num1 is divided by zero")
else:
print("invalid symb")
print()
print("Calculate anything else, I'm thee for you")
🇺🇸
More news from United StatesUnited States
NORTH AMERICA
Related News

Master Local Fine-Tuning with "gemma-trainer"
8h ago
Building a Plugin-Free Newsletter Popup on WordPress: Custom REST Endpoint Mailchimp API v3
8h ago
ภาษาโปรแกรมมิ่งที่ syntax ง่าย ทำให้ AI หลอนน้อยลง จริงหรือ?
8h ago
How I Built a File-Timestamp-Based Feedback Loop to Enforce AI Output Quality
8h ago
GitHub Trending Digest — 2026-07-07
9h ago