Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Absolutely true, I was searching for linear extrapolation furmula, before I took a look here.
but for some reason everyone votes as usual )
You're welcome )
In python, conditional and Boolean expressions contain empty objects(0, None, ", [], {} ...) are treated as False, not empty(1, [1, 2] , {34, 45}, ' qwerty', print, int) as True. But it is important to remember that they are not equal! That is, 1 == True, but 1 is not True. For example: if 3+5: print('hi') here 3+5 is not an empty object that is perceived as True in the context of a conditional expression. But at the same time (3 + 5 ) != True.
Now about the main thing. Logical operations in python use so-called Lazy Evaluation. This means that in an expression for example: (False and True) values are calculated in order from left to right, but and gives True only if both(all) operands are True, that is, as soon as python gets False in an expression with AND, it knows that the truth will not work and immediately returns this value. An expression with OR gives True if at least one operand is True, that is, it will return the first one that comes along, but if it does not find it, it will return the last one.
Here I hope I pushed you on the right path and didn 't confuse you too much : D
Yes! now it works thanks! The funny thing is that I thought to press reset myself, but I didn't do it for something I wrote here... it 's even a shame ) conclusion - you should not rush haha
Click reset, try again.
I think it is not necessary to prove that the task is simple, but:
Traceback (most recent call last):
File "main.py", line 2, in
import codewars_test as test
ModuleNotFoundError: No module named 'codewars_test'
please fix it)
Copy/paste from Details )
I wanted to make the same assignment in the first line of the code, but I got an error because I did not put parentheses in tuples.
Dude, this is really elegant! Thanks to you, I've learned a lot about ternary operators and unpacking tuples in them !
Thank you!
Really cool ! My solution is very cumbersome :( I hope with experience it will come!
Why does my solution with a while loop give a result for 100 digit numbers in less than a second and this is in the debugger in the browser! And here is a time error!?
thank you, i'll definitely read.
It's unpacking.
Here's a good article that I highly recommend anyone interested to read:
https://stackabuse.com/unpacking-in-python-beyond-parallel-assignment/
Insane!
can anyone explain how * works in this case?
Loading more items...