r/PythonLearning • u/No_Use3178 • 7h ago
Python library idea
Python learners and programmers: What's your biggest coding difficulty?
When using Python, what small problem or task do you find difficult or annoying?
Is there any function or simple tool you wish Python had to make coding easier?
I'm planning to build a small Python library based on real problems people face. I'd love to hear your experiences!
5
Upvotes
View all comments
Show parent comment
1
u/Fun_Army2398 6h ago
I'm not sure how map would solve this. It would apply the same function to every element, so each time the trigger condition is met
doSomething()would run, rather than only the first time. I'd still need to track that boolean manually. Right?if trigger: breakdoesn't work because I want to keep processing the iterable after the trigger is found. If you meantif trigger: doSomething(); continuethis doesn't work because I only want todoSomething()the first time trigger returns true.The only way that I know of doing this is to track if that condition has been met yet or not.