This repository contains my Python practice lessons.
Each folder represents a separate lecture with examples and exercises.
- Topic: Typing, Variables, Strings, Numbers, Boolean Algebra, Branching
- Folder:
1. Introduction. Typing. Variables. Strings and Numbers. Boolean Algebra. Branching - File:
lection_1_python_2025.py - Description: Basics of Python, variables, strings, numbers, boolean logic, and conditional branching.
- Topic: Exception Handling, Lists, Strings in Detail, Slices, Loops
- Folder:
2. Exception Handling. Lists, Strings in Detail, Slices, Loops - Files:
lection_2_python_2025.pypractice.py
- Description: Learn how to handle errors with
try/except, work with lists and strings, understand slicing, and use loops in depth.
-
Create a list
numberswith numbers from 1 to 10.- Print each number squared.
- Find the sum of all numbers.
-
Create a string
textand print each character in a loop. -
Use slices to print the first 5 and last 5 characters of
text. -
Print numbers from 1 to 20 divisible by 3.
-
Find the sum of numbers from 1 to 100 using a
whileloop. -
Create an infinite loop asking the user for a number and print its square.
- Exit when the user enters
0orexit.
- Exit when the user enters
-
Print unique words from a list with duplicates.
-
Ask the user for text and count vowels (
a, e, i, o, u). -
Replace all occurrences of a word in a sentence with
"replaced". -
Remove duplicates from a list without using sets.
-
Find the smallest and largest number in a list without using built-in functions.
-
Implement the FizzBuzz task:
- Print numbers from 1 to
n. - Replace multiples of 3 with
"Fizz", 5 with"Buzz", and both with"FizzBuzz".
- Print numbers from 1 to
12.1 Make FizzBuzz dynamic — ask the user for both divisors and n.
- Open a terminal in the desired lesson folder.
- Run the Python file, for example:
python lection_2_python_2025.py