Looping over and transforming characters
A string is a sequence of characters, and many text problems are solved by going through it character by character and building a…
Take your knowledge of strings to the next level. In this lesson you will learn how to loop over and transform characters with ord and chr, how to split, join and search text, how to format tables and numbers, and how to clean and normalize strings. You will solve classic text problems such as palindromes, ciphers, acronyms or compression, with practical exercises.
A string is a sequence of characters, and many text problems are solved by going through it character by character and building a…
A large part of working with text consists of cutting it into pieces, joining them again and locating specific parts. Python has…
f-strings accept a format specifier after a colon, which controls the width, the alignment and the decimals. With it you can…
The texts that people write arrive messy: mixed capitals, extra spaces, accents, signs. Normalizing is transforming them into a…
Almost every text problem is solved by combining a few patterns. Recognizing them saves you a lot of time.
Create a Python program that forms the acronym of a sentence with the first letter of each word.
Create a Python program that counts how many times each vowel appears in a text.
Create a Python program that splits an email address into user and domain with the partition method.
Create a Python program that cleans up a carelessly written name.
Create a Python program that checks whether a sentence is a palindrome, that is, whether it reads the same from left to right as…
Create a Python program that encrypts a text with the Caesar cipher, which shifts each letter a fixed number of positions in the…
Create a Python program that compresses a text by indicating how many times each letter is repeated consecutively.
Create a Python program that checks whether a password meets some rules and says which ones it breaks.
Create a Python program that prints a receipt with well-aligned columns using f-string formatting.