• Learn Bytes And UTF-8 Properly And Don't Get Lost In Jumbled Letters!

Hello, checkiomates🐱‍👤!

Dive into bytes sequence and UTF-8 encoding and solve a new mission about measuring a level of jumbling letters in a word!

💡TIP

At every mission page, under the editor window, there is a terminal window. If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!

🏁MISSION

Jumbled Letters by freeman_lex -

Let's try to evaluate a level of jumbling letters in a word. In this mission you are given two words - normal and jumbled version. If the jumbled one is not a version of a normal or rule is not followed, you function must return -1. For the totally same looking words return 0, of course. Otherwise, exclude first and last characters (they are not jumbled according to the rule) and return an average distance (rounded to 2 digits) between normal position of a character and its jumbled position.

jumbled("vehicle", "vheclie") == 1.2
jumbled("checkpoint", "cehkipont") == -1
jumbled("doctor", "doctor") == 0

📖ARTICLE

`bytes`: The Lesser-Known Python Built-In Sequence • And Understanding UTF-8 Encoding -

We all have topics we feel we ought to know but never bothered learning properly. Usually, whenever I need to enter the name of a character encoding, I just type in "UTF-8" since I know it's the most common one, and then move on. But what's UTF-8?

👩‍💻CODE SHOT

How do you think, what the following code does?

def ???????(struct):
    try: return 1 + max(map(???????, struct), default=0)
    except TypeError: return 0

🙌 Thanks for your attention! Hope to meet you at CheckiO, as well as at our Instagram and Twitter! We are really interested in your thoughts! Please, leave a comment below! ⤵

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