def check_if(value):
list_if = [
('ETH+PASL', 7),
('ETH+DCR', 8),
('/pools', None),
# и так далее
]
for check_v, check_len in list_if:
if value in check_v and ((check_len == len(value)) if check_len else True):
return True
check_if(m.text)
def is_conditions_for_some_shit_pass(m):
return ((m.text in '/Ethash' and len(m.text)>7)
or (m.text in '/DCR' and len(m.text)>3)
or (m.text in '/SIA' and len(m.text)>3)
# ....
or (m.text in 'ETH+PASL' and len(m.text)==8)
or (m.text in 'ETH+DCR' and len(m.text)==7))
#####
if is_conditions_for_some_shit_pass(m):
pass
#каждое условие отдельно
isGreaterThanFive = lambda x: x >5
isSmallerThanTen = lambda x: x<10
# или в виде комбинированого условия
matches_criteria_1 = lambda v: v >5 and v<10
n = 4
if (isGreaterThanFive(n) and isSmallerThanTen(n)):
print "matches"
else:
print "dont match"
v = 9
if (matches_criteria_1(v)):
print "matches"
else:
print "dont match"