40
Last seen 4 days ago
Member for 9 years, 10 months, 19 days
Difficulty Advanced
Hi, you could use `int.__mul__` instead of `lambda x, y: x * y` and `None` instead `lambda x: x != 0`.
More
This could be a cool one-liner, if you omitted _pattern_ and changed def to lambda. [Here](http://www.checkio.org/mission/fizz-buzz/publications/suic/python-3/bobrikos-one-lines/) it is. Thanks for inspiration.
More
Hi, you don't need list comprehension at all:
1. [] are redundant.
2. Look at _filter()_.
More
Hi,
1. `sum(array) * len(array)` is redundant you can `return 0`.
2. If `array` is not empty then `array[len(array)] == array[-1]`.
More
Hi, all the nested `if`s are redundant. __bool__ is subclass of __int__. You could write e. g.:
elif operation == 'equivalence':
return x == y
More
It's a bit "overlamdized" :)
A small tip:
# Change b, c in a way you don't need to use not
# and then you can write:
return a(data) and b(data) and c(data)
# what you could transform
return all((a(data), b(data), c(data)))
# and finally:
return all(f(data) for
More
Hi, a few things:
1. string is iterable therefore list() is redundant.
2. check str.isupper
3. in python you can write: 'A' <= letter <= 'Z'
More
Hi, two things:
1. Why text[::], why not just text?
2. lambda is redundant:
lambda x: x.isupper()
# is the same as
str.isupper # without ()!
More
Hi, in this case:
lambda l: l.isupper()
# is the same as:
unicode.isupper # without ()!
More
Hi, you could omit the if in lambda:
# 1. using filter()
# 2. or use True == 0 and 0 * string = "":
x * x.isupper()
More
Hi, 30 minutes... hmmmm... It's a shame that there's no _Obfuscated_ category in checkio.
More
Hi,
this is rather long and inefficient (`str` is immutable etc.) baby-python. I bet you can make this an efficient one-liner. If it was meant as a joke, than sorry :)
Regards,
suic
More