🇺🇦 Python Programming Сhallenges
1.04K subscribers
3 photos
2 files
63 links
Размышления на тему решения различных задач по спортивному программированию на Python и не только.
加入频道
Hypermodern Python 👩‍🚀 🐍

Chapter 1: Setup
Chapter 2: Testing
Chapter 3: Linting
Chapter 4: Typing
Chapter 5: Documentation
Chapter 6: CI/CD

https://cjolowicz.github.io/posts/hypermodern-python-01-setup/
I can't recall where I saw this originally, but you can use the spaceship operator "--0--" to turn floor division into ceiling division:

>>> 12//5
2
>>> --0-- 12//5
3

There's also the ++0++ operator when you want to emphasize that you really *do* mean floor division:

>>> ++0++ 12//5
2


from https://bugs.python.org/issue43255#msg387248
But yes, -(-n // d) is the easy (if a little bit cryptic) way to get the ceiling of n / d.
Forwarded from 🇺🇦 Go for two :)
How to Make Your Code Reviewer Fall in Love with You:

1. Review your own code first
2. Write a clear change list description
3. Automate the easy stuff
4. Answer questions with the code itself
5. Narrowly scope changes
6. Separate functional and non-functional changes
7. Break up large change lists
8. Respond graciously to critiques
9. Be patient when your reviewer is wrong
10. Communicate your responses explicitly
11. Artfully solicit missing information
12. Award all ties to your reviewer
13. Minimize lag between rounds of review

https://mtlynch.io/code-review-love/
Introduction to OWASP Top 10 2021

https://owasp.org/Top10/