Saadi381 Saadi381 - 3 months ago 7x
Python Question

Converting String into Integer and matching to an integer

been trying this with no luck

y = ("586MB Available")
x= re.findall (r'\d+',(y))

>>> x

if x == 586:
print ('yes')
else :
print ("No")


tst tst

x is a list of string. You must convert the first element to an int:

int(x[0]) == 586

or if you want to have an inequality:

int(x[0]) < y