49
Awesome Team
Philippe Cholet
https://github.com/Philippe-Cholet
Last seen 7 minutes ago
Member for 6 years, 2 months, 27 days
Difficulty Advanced
I was a math teacher in France for two years. I'm currently reconverting to IT, I'm here to improve my Python skills, and practice English.
This is an obfuscation of [my 3rd party solution](https://py.checkio.org/mission/blood-distribution-3/publications/Phil15/python-3/scipy-19-milp-mixed-integer-linear-programming/). Tricks here:
- `integrality=0,` and `lb=0,` are actually default values so I didn't need to write those
- 1-letter na
More
* I prefer `for a, b in ...` at `for x in ...: x[0], x[1]`.
* tuples: please `(a, b)` not `tuple([a, b])`
* list/set/... comprehension is good.
* `abs` is optional but kind of appropriate here.
* I'm pretty sure sets are not useful for you here, lists should be enough.
Sets could be good with a
More
You do not use x at all but the digits of the number so just iterate on them
def beginning_zeros(number: str) -> int:
count = 0
for digit in number:
if digit == "0":
count += 1
else:
break
return count
More