So you can learn Python in 5 hours?! It's until you met "invalid syntax")
This week two new missions are waiting for you to try your skills! And don't forget, that any time you may become the author of missions as well😉. It's not hard!
🏁 NEW MISSIONS:
Interesting, intersecting by freeman_lex - A square on the two-dimensional plane can be defined as a tuple (x, y, l), where (x, y) are the coordinates of its bottom left corner and l is the length of the side of the square (we only consider squares that are aligned to the axes). Given two squares as tuples (x1, y1, l1) and (x2, y2, l2), your function should determine whether these two squares intersect , that is, their areas have at least one point in common, even if that one point is merely the shared corner point when these two squares are placed kitty corner.
squares_intersect((2, 2, 3), (5, 5, 2)) == True squares_intersect((3, 6, 1), (8, 3, 5)) == False squares_intersect((3000, 6000, 1000), (8000, 3000, 5000)) == False
When "k" is Enough! by freeman_lex - Given a list of items, some of which may be duplicated, create and return a new Iterable that is otherwise the same as items , but only up to k occurrences of each element are kept, and all occurrences of that element after those first k are discarded. Note also the counterintuitive but still completely legitimate edge case of k == 0 that has a well defined answer of an empty list!
list(remove_after_kth([42, 42, 42, 42, 42, 42, 42], 3)) == [42, 42, 42] list(remove_after_kth([42, 42, 42, 99, 99, 17], 0)) ==  list(remove_after_kth([1, 1, 1, 2, 2, 2], 5)) == [1, 1, 1, 2, 2, 2]
💡Wanna read something interesting?! Here are some LINKS for your attention!
What does "invalid syntax" message means? - Python’s “invalid syntax” error message comes up often, especially when you’re first learning Python. What usually causes this error and how can you fix it? (Almost) all answers you will find in this article.
Learn Python in 5 hours!)) - Haven't you heard!? You may learn Python in less than 5 hours! I think it's a hype title, but if you a beginner and are just looking for video with examples and good pronunciation, it's it!
Writing Python functions that someone else would enjoy using - This short article suggests us, how to write better (documented) functions. It's especially will be useful for you, if you use a lot of functions, use your old legacy code, or someone else is going to use your code! Be a polite coder!😉
🙌 We are really interested in your thoughts! Please, leave a comment below! ⤵
Welcome to CheckiO - games for coders where you can improve your codings skills.
The main idea behind these games is to give you the opportunity to learn by exchanging experience with the rest of the community. Every day we are trying to find interesting solutions for you to help you become a better coder.Join the Game