본문 바로가기

Python_Matter

(324)
Backward Each Word Quiz> In a given string you should reverse every word, but the words should stay in their places. Input: A string. Output: A string. Example: backward_string_by_word('') == '' backward_string_by_word('world') == 'dlrow' backward_string_by_word('hello world') == 'olleh dlrow' backward_string_by_word('hello world') == 'olleh dlrow' Precondition: The line consists only from alphabetical symbols and..
Find Quotes Quiz> Your task at hand is to find all quotes in the text. And, as is already usual, do everything as quickly as possible :) You are given a string that consists of characters and a paired number of quotation marks. You need to return an Iterable consisting of the texts inside the quotation marks. But choose only quotes with double quotation marks ("). Single quotation marks (') aren’t appropria..
Count Digits Quiz> You need to count the number of digits in a given string. Input: A Str. Output: An Int. Example: count_digits('hi') == 0 count_digits('who is 1st here') == 1 count_digits('my numbers is 2') == 1 count_digits('This picture is an oil on canvas ' 'painting by Danish artist Anna ' 'Petersen between 1845 and 1910 year') == 8 count_digits('5 plus 6 is') == 2 count_digits('') == 0 def count_digit..
All the Same Quiz> We have prepared a set of Editor's Choice Solutions. You will see them first after you solve the mission. In order to see all other solutions you should change the filter. In this mission you should check if all elements in the given list are equal. Input: List. Output: Bool. Example: all_the_same([1, 1, 1]) == True all_the_same([1, 2, 1]) == False all_the_same(['a', 'a', 'a']) == True all..
Non-unique Elements Quiz> We have prepared a set of Editor's Choice Solutions. You will see them first after you solve the mission. In order to see all other solutions you should change the filter. If you have 50 different plug types, appliances wouldn't be available and would be very expensive. But once an electric outlet becomes standardized, many companies can design appliances, and competition ensues, creating ..
Popular Words Quiz> In this mission your task is to determine the popularity of certain words in the text. At the input of your function are given 2 arguments: the text and the array of words the popularity of which you need to determine. When solving this task pay attention to the following points: The words should be sought in all registers. This means that if you need to find a word "one" then words like "..
Sort Array by Element Frequency Quiz> Sort the given iterable so that its elements end up in the decreasing frequency order, that is, the number of times they appear in elements. If two elements have the same frequency, they should end up in the same order as the first appearance in the iterable. Input: Iterable Output: Iterable Example: frequency_sort([4, 6, 2, 2, 6, 4, 4, 4]) == [4, 4, 4, 4, 6, 6, 2, 2] frequency_sort(['bob'..
Pawn Brotherhood Quiz> We have prepared a set of Editor's Choice Solutions. You will see them first after you solve the mission. In order to see all other solutions you should change the filter. Almost everyone in the world knows about the ancient game Chess and has at least a basic understanding of its rules. It has various units with a wide range of movement patterns allowing for a huge number of possible diff..