Python Forum
Python calculator divide by zero help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python calculator divide by zero help
#4
Technically you should only be preventing a divide BY zero (a zero in the denominator). Zero divided by zero is undefined and zero divided by any other number is zero.

In your case, you should only be guarding against y == 0.
"So, brave knights, if you do doubt your courage or your strength, come no further, for death awaits you all with nasty, big, pointy teeth!" - Tim the Enchanter
Reply


Messages In This Thread
Python calculator divide by zero help - by dock1926 - Jan-19-2020, 09:59 PM
RE: Python calculator divide by zero help - by Marbelous - Jan-20-2020, 05:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need some help trying to get my Python mortgage amortization calculator to work prope IamSirAskAlot 4 15,934 Feb-12-2024, 10:53 PM
Last Post: BerniceBerger
  New to python, trying to make a basic calculator AthertonH 2 1,227 Apr-14-2022, 03:33 PM
Last Post: AthertonH
  Divide a number by numbers in a list. Wallen 7 8,292 Feb-12-2022, 01:51 PM
Last Post: deanhystad
  How To Create A "Birthday Calculator" in Python? unigueco9 3 3,943 Oct-11-2021, 08:03 PM
Last Post: SamHobbs
  python calculator only using decomposing functions kirt6405 1 1,833 Jun-19-2021, 12:52 AM
Last Post: bowlofred
  how to divide one big equation entered as a string to small chunks gungurbuz 1 1,688 May-28-2020, 03:46 PM
Last Post: Larz60+
  how to divide array number chinting 5 3,044 Dec-30-2019, 11:29 AM
Last Post: ibreeden
  Python Program to Make a Simple Calculator jack_sparrow007 2 10,346 Oct-19-2018, 08:32 AM
Last Post: volcano63
  Python don't divide SteLu 8 5,418 Dec-21-2017, 02:58 PM
Last Post: casevh
  Creating a Calculator with Python KatherineHov 8 7,944 Aug-03-2017, 02:13 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020