11
Last seen 3 years ago
Member for 9 years, 1 month, 28 days
Difficulty Normal
Clever trick with the [o[:2]] there. ;)
But this also has to create all the dictionary elements, and for that, all the boolean operation for the values need to be performed.
More
The int conversion is not necessary, because bools are also ints. Also, you could have broken up line 1 into multiple lines. This is not very readable.
More
You could do
if digit:
result *= digit
one lines 9 and 10; more concise that way. Do away with line 5 and instead on line 7
for str_digit in str(number)
no point in creating a variable if it's only used once. ;)
More
> **How it is used:** This task can teach you how to solve a problem with _simple data type conversion_.
Did you read that hint in the mission story? ;)
More