+ 2

what's the problem when i try 'mmi' it prints 'no'

https://code.sololearn.com/cMSXaBRpb78N/?ref=app

16th May 2020, 6:08 PM
amir amiri
4 odpowiedzi
+ 2
In Python you can't just say if "1" or "2" or "3" in "135": (for example), you would have to say string = "135" if "1" in string or "2" in string or "3" in string: This means that would make your if statement very very long and I would suggest a shortcut. if max(a,b,c,...,z) > 1:
16th May 2020, 6:25 PM
Russ
Russ - avatar
+ 3
Thanks Russ Your comment helped me a lot
16th May 2020, 6:29 PM
amir amiri
+ 2
I tried that too But it's not working yet.
16th May 2020, 6:19 PM
amir amiri
+ 2
amir amiri Because mmi contains m-2 and i -1 And according to your Condition (i or m) > 1 (1 or 2) > 1 1 > 1 //which is false If there is (m or i) then you get yes because 2 > 1 if you take iim then returns yes
16th May 2020, 6:20 PM
A͢J
A͢J - avatar