+ 4
So my question is Let a=[1,0,1,0,1] so why if i use a==a.reverse() in in condition it does not satisfy
if(a==a.reverse()): print(True) else: print(False) why output is false
2 Antworten
+ 8
This is because the reverse() fonction does not return anything. You should use for this a[::-1] as it is in the code below 👍
https://code.sololearn.com/cgb6oo9EaJ2L/?ref=app
+ 2
Thnx