Why Pyrhon doesn't see variable b (line 12)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Why Pyrhon doesn't see variable b (line 12)?

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

13th May 2019, 5:21 PM
Ilya R
Ilya R - avatar
2 Answers
+ 5
num2 is a list and num is an int so num == num2 returns False
13th May 2019, 6:34 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 3
As Mert already mentioned, your function look_for_pol() returns False. This is then assigned to b. if b == True does fail to append b to list result, results is an empty list that creates an error by trying to use the max() function. So review line 3 and 4 of your function look_for_pol().
13th May 2019, 7:16 PM
Lothar
Lothar - avatar