-
Try To Solve Cryptarithmetic Puzzle Using Built-in Functions!
Hello, checkiomates🐱👤!
Today's digest definitely makes you a better pythonists! It consists of string fornatting quiz, full custom guide to build-in fuctions, template method pattern example and a challenging solver of cryptarithmetic puzzle! The Python is calling you!
💡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
Cryptarithmetic Puzzle by kurosawa4434 -
In this puzzle, each letter must be assigned a one-digit number to complete the calculation. You are given a list of words. The last word is the sum. You have to return a dictionary with the alphabets as keys and the one-digit numbers as values. NOTE: Each letter should represent a different digit. The leading digit of a multi-digit number must not be zero. All tests always have one answer.
cryptarithm_solver(['SEND', 'MORE', 'MONEY']) == {'S': 9, 'E': 5, 'N': 6, 'D': 7, 'M': 1, 'O': 0, 'R': 8, 'Y': 2}
📖ARTICLES
Layman's Guide to Python Built-in Functions -
The content of the built-in functions documentation favors precision and correctness over comprehension for beginners. While this style is great for experienced developers who already understand the finer points of Python’s design, the docs are confusing to novice programmers like a 12 year old who is not far on his journey of learning Python. This guide is an opinionated and simplified description of Python’s built-in functions. My goal is to provide definitions, in plain English, of each built-in function that comes with Python. Along with each definition is an example that is as simple as I can think of. I ran each example against the latest version of Python as of the time writing this guide.
Understanding the Template Method Pattern in Python -
The Template Method pattern defines the skeleton of an algorithm in a base class but lets subclasses override specific steps of the algorithm without changing its structure. It's called "template method" because it defines a template for an algorithm's steps.
Python String Formatting: Available Tools and Their Features Quiz -
Test your understanding of Python’s tools for string formatting, including f-strings, the .format() method, and the modulo operator.
👩💻CODE SHOT
How do you think, what the following code does?
def ??????????????(text: str) -> str: return ' '.join(x[::-1] for x in text.split(' '))
🙌 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