Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if with range
#1
Good Day,
I want to check if any of this variable over 200 must print not within range can someone help me how can I do it

a = 12
b = 30
c = 50
# testing if variables a,b,c within the range
 
for i in range(1,200):
    if a  == i:
        continue
    elif b == i:
        continue
    elif c == i:
        print('a , b , c within the range')
        
    else:
        print('Not within the range')
Moderator: nilamo: adding code tags
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