sday, December 12, 2023 3:58 AM
To: python-list@python.org
Subject: Re: A problem with str VS int.
Op 12/12/2023 om 9:22 schreef Steve GS via Python-list:
> With all these suggestions on
> how to fix it, no one seems to
> answer why it fails only when
> entering a two-digit numbe
On 12/12/23 21:22, Steve GS wrote:
With all these suggestions on
how to fix it, no one seems to
answer why it fails only when
entering a two-digit number.
One and three work fine when
comparing with str values. It
is interesting that the
leading 0 on a two digit
worked. Still, one digit and
Op 12/12/2023 om 9:22 schreef Steve GS via Python-list:
With all these suggestions on
how to fix it, no one seems to
answer why it fails only when
entering a two-digit number.
One and three work fine when
comparing with str values. It
is interesting that the
leading 0 on a two digit
worked.
.
This is now more of a
curiosity as I did use the
integer comparisons.
SGA
-Original Message-
From: Python-list
On
Behalf Of dn via Python-list
Sent: Sunday, December 10,
2023 12:53 AM
To: python-list@python.org
Subject: Re: A problem with
str VS int.
On 10/12/23 15:42, Steve GS
via Python-list
On 10/12/23 15:42, Steve GS via Python-list wrote:
If I enter a one-digit input or a three-digit number, the code works but if I
enter a two digit number, the if statement fails and the else condition
prevails.
tsReading = input(" Enter the " + Brand + " test strip reading: ")
On 12/9/2023 9:42 PM, Steve GS via Python-list wrote:
If I enter a one-digit input or a three-digit number, the code works but if I
enter a two digit number, the if statement fails and the else condition
prevails.
tsReading = input(" Enter the " + Brand + " test strip reading: ")
user can enter any text, they might enter ".01" or "hello" or al kinds of
nonsense.
If you converted to numbers and tested whether it failed, ...
-Original Message-
From: Python-list On
Behalf Of Steve GS via Python-list
Sent: Saturday, December 9, 2023 9:42 PM
To:
If I enter a one-digit input or a three-digit number, the code works but if I
enter a two digit number, the if statement fails and the else condition
prevails.
tsReading = input(" Enter the " + Brand + " test strip reading: ")
if tsReading == "": tsReading = "0"