I could use sum for counting true values. But, there are no false values. So, why need to filter Also, it looks messy because there is no false . I know. I wrote gibberish because yk... It's not a good example.. Written in stress
A huge number of covid babies are struggling from no social interaction. They just default into programming because they spend their entire lives brainrotting at a computer. I hope that you maintain a good social life and are not trying to turn addiction into a career.
•
u/Sea-Ad7805 Sep 14 '26 edited Sep 14 '26
It's wrong, you don't test for
True/Falsevalues.EDIT: I forgot, using
any()is more elegant, and faster because it's done when it sees the firstTruevalue:Run this program instead in Memory Graph Web Debugger to see the program state change step by step.
9
u/Mamuschkaa Sep 14 '26 •
Replace len(...) with sum(...) so that if some of the variables get false, they are not counted.
2
u/DR4C0_R41 Sep 14 '26
Very helpful for therapy lol.
2
u/Lachtheblock Sep 14 '26
Even if all of those were false, you'd still have too many problems.
18
u/MudFrosty1869 Sep 14 '26 •
This ain't code, this is a diary entry.
2
u/Naive_Programmer_232 Sep 14 '26
well, it's logical
1
u/python_gramps Sep 14 '26
Instead of len(my_life), sum(my_life) will return the number of trues.
2
u/Traditional_Good_792 Sep 14 '26
Get a heartbreak you will be fixed
2
u/davisousamalbatahan Sep 14 '26
Sjsjsjsjdkdkdjdkdkdk
2
u/jeman_jmbt_mntn Sep 14 '26
Deymmmm brow you have many problems 😂
2
u/[deleted] Sep 14 '26
funniest polish python joke is the fact that
bool("dupy")evaluates to True, because you pronounce it the same as "ból dupy"https://en.wiktionary.org/wiki/b%C3%B3l_dupy
2
u/RedeINC Sep 14 '26
Python
4
u/mixedd Sep 14 '26 •
Story of my life 😅
2
u/Next-Call8862 Sep 14 '26
del my_life[:len(my_life)]
That should do it.
0
u/code_tutor Sep 17 '26
A huge number of covid babies are struggling from no social interaction. They just default into programming because they spend their entire lives brainrotting at a computer. I hope that you maintain a good social life and are not trying to turn addiction into a career.
0
u/[deleted] Sep 14 '26
[deleted] — view deleted comment