kyu_6.your_order_please package

Submodules

kyu_6.your_order_please.order module

kyu_6.your_order_please.order.order(sentence: str) → str[source]

Sorts a given string by following rules:

  1. Each word in the string will contain a single number. This number is the position the word should have in the result.

  2. Note: Numbers can be from 1 to 9. So 1 will be the first word (not 0).

  3. If the input string is empty, return an empty string. The words in the input String will only contain valid consecutive numbers.

param sentence

Each word in the string will contain a single number

return

sorted string

kyu_6.your_order_please.test_order module

class kyu_6.your_order_please.test_order.OrderTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing ‘order’ function

test_order()[source]

Your task is to verify that ‘order’ function sorts a given string by following rules:

  1. Each word in the string will contain a single number. This number is the position the word should have in the result.

  2. Note: Numbers can be from 1 to 9. So 1 will be the first word (not 0).

  3. If the input string is empty, return an empty string. The words in the input String will only contain valid consecutive numbers.

Returns

Module contents