+ 1
Can anyone explain the reason of the answer
while [()]: print("1") else: print("2")
3 ответов
+ 2
[()] is a list that contains an empty tuple.
An empty list has falsy value, a non empty list has truthy value.
In this case the list is not empty, so the while loop will repeat for ever.
+ 2
Thanks for answering