Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if with range
#4
(Mar-08-2017, 08:36 PM)Federer Wrote: I want to check if any of this variable over 200 must print not within range

If the only necessary check is whether any variable is (not) above 200, maybe this is sufficient:
a = 12
b = 30
c = 50
# testing if variables a,b,c within the range
  
if a <= 200 and b <= 200 and c <= 200:
    print('a , b , c within the range')
else:
    print('a or b or c not within the range')
Reply


Messages In This Thread
if with range - by Federer - Mar-08-2017, 08:36 PM
RE: if with range - by nilamo - Mar-08-2017, 08:41 PM
RE: if with range - by zivoni - Mar-08-2017, 08:43 PM
RE: if with range - by merlem - Mar-09-2017, 04:49 PM
RE: if with range - by buran - Mar-09-2017, 05:54 PM
RE: if with range - by zivoni - Mar-09-2017, 08:36 PM
RE: if with range - by buran - Mar-09-2017, 09:44 PM

Forum Jump:

User Panel Messages

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