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.
Instead of saying
- 1 * (expression)
, you could say- (expression)
, as boolean values are interpreted as 1 or 0 in arithmetic, and you can subtract those as well like you can do with (almost) any value.A regular expression can only match strings or bytes-like objects. Python, unlike JavaScript, does not convert numbers to strings automatically, something you can already see when doing
"abc" + 1
.This solution is not using PEP8, isn`t it?
מגניב ביותר!!!
Right, thank you for the reminder!
re.match()
looks at the beginning of the string (see doc).re.search()
looks anywhere in the string (see doc).The regex only checks, if the code contains a 1,2 or 3. It's not checking, if it starts with 1,2 or 3.