At the beginning i thought it's a cool trick,
but after i knew that, it's a built-in method.
So it's technically same as the for loop i wrote, but it was written long time ago :)
knowing the built-in methods is my goal right now. Thanks

You can assume that in Python, there is always a clever built-in method to do basic stuff. That goes for counting, sorting, spliting, parsing, etc...
Trying to solve it youself iteratively is a good practice but try to find that time saving built-in method.
For example an other handy list method is .sort(), check it out and pay attention to its "key" parameter ;)

sqrt() is computed using floating point is prone to precision error. Without round(), int() just truncates the result. If you result of sqrt is 1.9999999, int(1.999999) will be 1 instead of 2.

I feel like for 8 kyu and using them as practice for getting more comfortable with the basic interations of loops, dicts, tuples, lists, strings, and integers is great!

I plan use 8 kyu and up excersies in order to learn new languages. After I have gotten farther along with python I plan to start learning Rust next starting at the beginning.

Great solution, well done! This has gotten me to think differently about how I write my code

little correction for ==:

`if solution == nice: print('nice')`

I thought of the same :)

Yet another example of python's simplicity

At the beginning i thought it's a cool trick,

but after i knew that, it's a built-in method.

So it's technically same as the for loop i wrote, but it was written long time ago :)

knowing the built-in methods is my goal right now. Thanks

pretty

just look at other solutions using one additionnal line before the comprehension.

What's the O(n^2) solution ?

I find it useful to keep on hand the methods Python provides to sequence types like lists or dictionaries.

I never knew this before. Guess i learned something new :D

You can assume that in Python, there is always a clever built-in method to do basic stuff. That goes for counting, sorting, spliting, parsing, etc...

Trying to solve it youself iteratively is a good practice but try to find that time saving built-in method.

For example an other handy list method is .sort(), check it out and pay attention to its "key" parameter ;)

This comment is hidden because it contains spoiler information about the solution

sqrt() is computed using floating point is prone to precision error. Without round(), int() just truncates the result. If you result of sqrt is 1.9999999, int(1.999999) will be 1 instead of 2.

This comment is hidden because it contains spoiler information about the solution

I feel like for 8 kyu and using them as practice for getting more comfortable with the basic interations of loops, dicts, tuples, lists, strings, and integers is great!

I plan use 8 kyu and up excersies in order to learn new languages. After I have gotten farther along with python I plan to start learning Rust next starting at the beginning.

## Loading more items...