49
Phil15
30 56 64 Leader of the month
23067/ 25141
Last seen 3 hours 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.

Best reviews / Newest reviews
Xs and Os Referee-iskenderunbtr
I just propose a clarification of your code. I did not test it but it should work. ```python from typing import List def checkio(game_result: List[str]) -> str: for xo in 'XO': # check rows for row in game_result: if row == 3 * xo: return xo More
First-Adrian_Goh 1
Use global variables is usually a bad idea, like here. Honestly it should NOT have pass tests. You only pass them because of "check" part work, and little tests did not warn you about it. assert isometric_strings('add', 'egg') == True dict == {'a': 'e', 'd': 'g'} assert isometric_strin More
First-xiaoxiannv-TangTang
Note that `for each,i in zip(str1, range(len(str1)))` and `for i,each in enumerate(str1)` are equivalent. More
First-michalmikulasi 1
`num%2==0` is already a boolean True or False, you can return it. def is_even(num: int) -> bool: return num%2 == 0 More
[creative] Scientific imports + 1-liner: Markov chain-Phil15
Note that when I published this I could not put it in **creative** category where it clearly belongs. More
max, with a key-Phil15
Note: Here, `max` would be enough by itself (because isoformat is sortable by design), but it would be easy to change this solution to consider other datetime formats, something like: get_latest = functools.partial(max, key=lambda s: datetime.datetime.strptime(s, '%H:%M %d/%m/%Y')) More
[typed] Apply the rule and a simple reasoning-Phil15 1
@FromSnakeToPython Glad you liked the task. I enjoyed solving the task algorithmically more than manually. More
Clear, 5 lines of code-EdinsonUwU 1
`divmod(a, b)[1]` instead of just `a % b`. Okay why not! More
max_digit-Bondr
You can annotate with nearly whatever you want, but here `int` annotation is not useful, and `list` annotation is (useless and) just wrong in the sense that "map" returns an object that is not a list at all. "max" returns an integer (because "lnumber" is an iterable of integers), hence no need to c More
2 Solutions in 1-Alex_4444D
About the first, first... what about list comprehension? Second, I'm pretty sure it should not work. It counts the number of email addresses with "." or "+" in the name part. Plus, case would matter, and duplicates would be counted multiple times. ```python def unique_emails(emails: list[str]) -> i More
First-Alexandra_Berger
`text == text.upper() or len(text) == 0` is already a boolean True/False, just return it. No need of `len(text) == 0` since `'' == ''.upper()`. return text == text.upper() More
First-liuq901 1
I would use "for/else" instead of "flag". What do you think? for i in range(1, 101): for j in range(4): if i % prime[j] != attempts[j + 1][0]: break else: return [2, i] More
numpy for easy rotations, itertools.compress and zip (length-check py3.10+)-Phil15
**EDIT:** in the arguments are of the **same** lengths. More
First-Tanis1981
replace_all('o', 'o', 'oo') More
First-phongtt2
Compare with `>` already give a boolean, you can just return the (boolean) comparison: return items.count(True) > items.count(False) More
First-Nikolay86
You don't need "nonlocal" here. In a new example, define variable "s" inside "g" is okay, but we can't use the "s" outside for it. >>> def f(n): s = [] def g(i): s = s + [i**2] for i in range(n): g(i) return s >>> f(5) Traceback More
[typed] Coroutine, filters, cached expressions-Phil15
I think the "checkio" function should receive only one “step info” each time and process it, instead of giving the entire history, and a coroutine is a good way to do just that. Plus, it's a rare occasion to use `typing.Generator` in a meaningful way. More
+8 is not enough for this task =)-Kolia951
As the mission author, I receive emails about new solutions and saw the title of your solution and I'm glad you liked my task. =) More
str-Phil15
If you are reading this solution and asking yourself why this solution can even be publish (the function signature being clearly incorrect), it's because: 1. The mission (at the very beginning) did not have the second parameter which was latter added (to make it really different from another palind More
Simple and readable-malion
What would happen with `'[ord(s) for s in "GeneratorExp"]'`? More
1 2 3 4 5 6 7
8
9 10 11 12 13