35
Yoichi NAKAYAMA
Last seen 10 months ago
Member for 10 years, 3 months, 1 day
Difficulty Normal
You can remove [] and use generator expression, instead of the list comprehension.
More
Great! This code explicitly expresses that only total() depends on food and drink name.
More
We can make it more simple, by replacing "while number/2>0:" with "while number:"
More
Excellent.
As with sum(), you can use a generator expression with str.join().
More
It's too simple :) Just adds the k selected pieces.
More
The function has_number() returns True for non-ascii number representations.
```
>>> "①".isdigit()
True
```
More
Wow, I was impressed by the last line.
More
We can access each tuple element by index, so it is unnecessary to convert input tuple (elements) to list.
More
Cool oneliner solution!
You can also obtain same result without [], too.
More