• This week’s missions: Nearest Value and Broken Window

checkio

Hi guys!

Enjoy solving the new missions:

The first mission is called the “Nearest Value” and here you’re given a list of values (a set of numbers) and you need to find the nearest value (number) to the given one.

nearest_value([4, 7, 10, 11, 12, 17], 9) == 10
nearest_value([4, 7, 10, 11, 12, 17], 8) == 7

The second was created by kurosawa4434 and is the “Broken Window” mission where you need to restore the broken window glass by being given the height and width of the missing pieces.

broken_window([[1, 0], [1, 0]] == ([0], [1])                                       # or ([1], [0])
broken_window([[4, 0], [0, 1, 4, 0], [3, 0], [0, 3, 4, 1]] == ([1, 2], [0, 3])     # or ([3, 0], [2, 1])
    Here are some relevant and interesting articles for you:
  • - Check out the release notes for Django 2.2 which covers the new features, as well as some backwards incompatible changes you’ll want to be aware of when upgrading from Django 2.1 or earlier.
  • Find out how to stand out in a Python coding interview, as well as how to use enumerate() to iterate over both indices and values, debug problematic code with breakpoint(), format strings effectively with f-strings, sort lists with custom arguments, use generators instead of list comprehensions to conserve memory, define default values when looking up dictionary keys, count hashable objects with the collections.Counter class, use the standard library to get lists of permutations and combinations.
  • Learn about monkey patching in Python, i.e., how to dynamically update code behavior at runtime, and see some quite useful examples.

Our congratulations to the winner of March 2019 - Phil15 - you are totally Awesome and we are very glad to have you here with us!

(sponsored) JetBrains’s PyCharm 2019.1. Develop quickly, and with confidence: configure your environment with pipenv, use the new and improved quick docs, and test with pytest fixtures.

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