49
Awesome Team
Philippe Cholet
https://github.com/Philippe-Cholet
Last seen 43 minutes ago
Member for 6 years, 3 months, 18 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.
You don't need to iterate on the text. You're almost lucky it even works.
def correct_sentence(text: str) -> str:
text = text[0].upper()+text[1:]
if text[-1] != ".":
text += "."
return text
More
Note that when I published this I could not put it in **creative** category where it clearly belongs.
More
@FromSnakeToPython Glad you liked the task. I enjoyed solving the task algorithmically more than manually.
More
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
For those who think it is not a real 1-liner: imports can be made inline and "def return" can be made "lambda". Without sacrificing clarity.
aggregate_and_count = lambda iterable, Counter=__import__('collections').Counter, it=__import__('itertools'): Counter(it.chain.from_iterable(it.starmap(it
More