Python Forum
[BeautifulSoup] ; comparing attributs with given value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[BeautifulSoup] ; comparing attributs with given value
#2
or create a function which can be reused:

def isbetween(x, y, z):
    if x >= y <= z:
        print(f"{x} is between {y} and {z}")
    else:
        print(f"{x} is not between {y} and {z}")

isbetween(15, 10, 20)
isbetween(9, 10, 20)
Output:
15 is between 10 and 20 9 is not between 10 and 20
Reply


Messages In This Thread
RE: [BeautifulSoup] ; comparing attributs with given value - by Larz60+ - Dec-13-2020, 12:52 PM

Forum Jump:

User Panel Messages

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