7
mikwa heeri
Last seen 1 year ago
Member for 10 years, 18 days
Difficulty Normal
It's just a flesh wound
I would recommend taking a look at the operator module. This module has functions for each of the operations needed and should be able to help reduce your code a lot. I also recommend using one return statement at the end of the function and assign the result to a variable. This makes the code ea
More
It wasn't until after I solved this for the first time and had a chance to look at other solutions that I "discovered" min() & max() lol. I didn't like setting default values of min/max to something in the tuple, but it worked.
More
This is a nice solution, but I'm having trouble figuring out how you handle the value of 0.
Can you please explain how you handle 0?
Also, can you explain the (int(d) or 1 for d in str(n)) part? I'm not sure when the 1 gets used instead of int(d).
I'm thinking the two are related, but I
More
I know there had to be a way to return a sorted list while grabbing the sorted value. I was doing return sorted(list[0]) instead of return sorted(list)[0].
Thanks for this solution!
More