• This week's missions: Train Tracks, Sort by Extension, and Words Order

checkio

Good day CheckiO users!

CheckiO Team continues improving the portal. We are glad to tell you that CheckiO Client has been updated. You can find the following improvements:

- the bugs concerning run and check of missions have been fixed;

- by using checkio open you can now open the solutions folder in your favorite editor;

- checkio config show and checkio config --raw allows you to control your current client configuration, e.g., you can configure active editor using command

checkio --domain js config set editor /usr/local/bin/sublime

The current update will allow you to upgrade your Checkio Client to the latest version using

checkio upgrade

But this time, please, still apply

pip3 install --upgrade checkio-client

If you still have any issues, please, don't hesitate to contact me.

Challenge yourself with our latest missions:

The first mission is called "Train Tracks" created by Phil15 for the Maya Island, and here you need to trace the train tracks in a rectangular gridfrom "start" to "end" taking into consideration the given constraints.

train_tracks([4, 6, 5, 3, 1, 3, 3, 4],  # rows
             [4, 2, 2, 3, 4, 5, 6, 3],  # columns
             (3, 0),                    # start
             (7, 6),                    # end
             {(3, 0): {'N'},            # constraints
              (4, 7): {'N', 'S'},
              (6, 4): {'E', 'W'},
              (7, 6): {'W'}},
             ) == 'NNNESESEENENESSSESSWWSWWSEEE'
  

The second mission is "Sort by Extension" in which you should sort the files in a given list by their extensions, or, in case the extensions match up, by the name.

 
sort_by_ext(['1.cad', '1.bat', '1.aa']) == ['1.aa', '1.bat', '1.cad']
sort_by_ext(['1.cad', '1.bat', '1.aa', '2.bat']) == ['1.aa', '1.bat', '2.bat', '1.cad']
sort_by_ext(['1.cad', '1.bat', '1.aa', '.bat']) == ['.bat', '1.aa', '1.bat', '1.cad']
sort_by_ext(['1.cad', '1.bat', '.aa', '.bat']) == ['.aa', '.bat', '1.bat', '1.cad']
sort_by_ext(['1.cad', '1.', '1.aa']) == ['1.', '1.aa', '1.cad']
sort_by_ext(['1.cad', '1.bat', '1.aa', '1.aa.doc']) == ['1.aa', '1.bat', '1.cad', '1.aa.doc']
  

The third is the "Words Order" missions where you have to check if the words in a list appear in the same order as in the given text.

words_order('hi world im here', ['world', 'here']) == True
words_order('hi world im here', ['here', 'world']) == False
words_order('hi world im here', ['world']) == True
words_order('hi world im here',
 ['world', 'here', 'hi']) == False
words_order('hi world im here',
 ['world', 'im', 'here']) == True
words_order('hi world im here',
 ['world', 'hi', 'here']) == False
words_order('hi world im here', ['world', 'world']) == False
words_order('hi world im here',
 ['country', 'world']) == False
words_order('hi world im here', ['wo', 'rld']) == False
words_order('', ['world', 'here']) == False
  
    Highlights from the world of Python:
  • We all know that remembering all the syntax when learning data science is quite hard. Regex Cheat Sheet is a great thing to shake your memory and find what you need when it comes to Python regular expressions (regex).
  • Find out everything that you can do with Python's Pathlib module for path manipulation. You might be surprised by how great it is. Just give it a try!
  • It's quite obvious how beneficial testing your code is, so you should have the best tools at your disposal. Boost your testing productivity with Pytest! See what benefits it offers, find out how to make repetitious tests more comprehensible, how to create and maintain reusable testing utilities, and other useful things.

Our congratulations to the winner of April 2020 - piter239 - you are totally Awesome and we are very glad to have you here with us!

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