본문 바로가기

Python_Matter

(324)
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..
Split Pairs Quiz> Split the string into pairs of two characters. If the string contains an odd number of characters, then the missing second character of the final pair should be replaced with an underscore ('_'). Input: A string. Output: An iterable of strings. Example: split_pairs('abcd') == ['ab', 'cd'] split_pairs('abc') == ['ab', 'c_'] Precondition: 0 1. a의 문자의 갯수를 변수에 할당한다. def split_pairs2(a): len_sp..