Lesson 1/6 · Graduation exam preparationNot startedhigh School~150 min
Strings
Tasks with text and first complete programs: a digit sum, a cipher, palindromes, a birth number, BMI and a quadratic equation.
After this lesson you'll be able to:
- Walk through a string with a loop and use slices
- Use string methods: `count`, `split`, `lower`, `isdigit`
- Handle bad input and split a program into functions
- Print exactly what the task asks for - the tests compare the output line by line (trailing spaces do not matter). Write any prompt you like in `input("…")`; the tests ignore it.
Theory (PDF)
The theory for this lesson is being prepared.
Examples to try
Your code runs only in this browser, in an isolated environment with no access to the internet or your account.
Examples for this lesson are being prepared.
Exercises
Start the exercises- Write a programDigit sumBasic10 XP
- Write a programHalf pyramidBasic10 XP
- Write a programBMI calculatorElementary20 XP
- Write a programFinding a characterBasic10 XP
- Small projectBirth numberIntermediate30 XP
- Write a programThe Fibonacci sequenceElementary20 XP
- Write a programMind readerIntermediate30 XP
- Algorithmic problemGreatest common divisorElementary20 XP
- Write a programA number inside a random numberElementary20 XP
- Write a programCaesar cipherElementary20 XP
- Write a programPalindromeBasic10 XP
- Write a programCharacters and wordsElementary20 XP
- Write a programQuadratic equationElementary20 XP
- Small projectRock, paper, scissorsElementary20 XP
- Write a programPassword checkElementaryOptional20 XP
- Predict the outputString slicesElementaryOptional20 XP