Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 863e553

Browse files
authored
Update main.py
1 parent f67f98a commit 863e553

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

projects/Calculator/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ def multiplication():
2525
def division():
2626
n1 = float(input("Enter first number: "))
2727
n2 = float(input("Enter second number: "))
28+
if n2==0:
29+
print("Invalid entry")
30+
return "Invalid entry"
31+
print(n1/n2)
2832

2933
return n1 / n2
3034

@@ -126,6 +130,8 @@ def binomail(num):
126130
elif c == "4":
127131
res = division()
128132
os.system("cls")
133+
if res =="Invalid entry":
134+
continue
129135
print(f"The answer is {res}")
130136
time.sleep(2)
131137
os.system("cls")

0 commit comments

Comments
 (0)