본문 바로가기

전체 글

(1836)
Sum Numbers Quiz> In a given text you need to sum the numbers. Only separated numbers should be counted. If a number is part of a word it shouldn't be counted. The text consists from numbers, spaces and english letters Input: A string. Output: An int. Example: sum_numbers('hi') == 0 sum_numbers('who is 1st here') == 0 sum_numbers('my numbers is 2') == 2 sum_numbers('This picture is an oil on canvas ' 'paint..
Split List Quiz> You have to split a given array into two arrays. If it has an odd amount of elements, then the first array should have more elements. If it has no elements, then two empty arrays should be returned. example Input: Array. Output: Array or two arrays. Example: split_list([1, 2, 3, 4, 5, 6]) == [[1, 2, 3], [4, 5, 6]] split_list([1, 2, 3]) == [[1, 2], [3]] def split_list(items: list) -> list: ..
First Word Quiz> You are given a string where you have to find its first word. When solving a task pay attention to the following points: There can be dots and commas in a string. A string can start with a letter or, for example, a dot or space. A word can contain an apostrophe and it's a part of a word. The whole text can be represented with one word and that's it. Input: A string. Output: A string. Examp..
Between Markers Quiz> You are given a string and two markers (the initial and final). You have to find a substring enclosed between these two markers. But there are a few important conditions: The initial and final markers are always different. If there is no initial marker, then the first character should be considered the beginning of a string. If there is no final marker, then the last character should be co..
Elementary Map Before a big journey begins, let's warmup a bit. Some very simple missions will help you remember how to use code as well as how CheckiO works. Don’t forget to check out the solutions of other users. Those are the best! Multiply(Intro) https://py.checkio.org/en/mission/multiply-intro https://developer-ankiwoong.tistory.com/853 Easy Unpack https://py.checkio.org/en/mission/easy-unpack https://dev..
Between Markers Quiz> You are given a string and two markers (the initial one and final). You have to find a substring enclosed between these two markers. But there are a few important conditions. This is a simplified version of the Between Markers mission. The initial and final markers are always different. The initial and final markers are always 1 char size. The initial and final markers always exist in a st..
Nearest Value Quiz> Find the nearest value to the given one. You are given a list of values as set form and a value for which you need to find the nearest one. For example, we have the following set of numbers: 4, 7, 10, 11, 12, 17, and we need to find the nearest value to the number 9. If we sort this set in the ascending order, then to the left of number 9 will be number 7 and to the right - will be number ..
Beginning Zeros Quiz> You have a string that consist only of digits. You need to find how many zero digits ("0") are at the beginning of the given string. Input: A string, that consist of digits. Output: An Int. Example: beginning_zeros('100') == 0 beginning_zeros('001') == 2 beginning_zeros('100100') == 0 beginning_zeros('001001') == 2 beginning_zeros('012345679') == 1 beginning_zeros('0000') == 4 Precondition..