r/PythonLearning • • Sep 14 '26

🥲Don't know why I wrote this code NSFW

Post image
139 Upvotes

35 comments sorted by

View all comments

•

u/Sea-Ad7805 Sep 14 '26 edited Sep 14 '26

It's wrong, you don't test for True/False values.

EDIT: I forgot, using any() is more elegant, and faster because it's done when it sees the first True value:

Run this program instead in Memory Graph Web Debugger to see the program state change step by step.

1

u/ProgramBrave718 Sep 14 '26

Yeah I made all True. But, will work on it later. But, it's not actual thing i mean i wrote the shit because of confusion. All are True because it's really in my life. For false values i can use sum. Because you know len does not care about the bool values

1

u/Sea-Ad7805 Sep 14 '26

I understand, but I thought it was a nice teaching example.

Besides that, try to relax, stress isn't helping anyone.