Lessons·teens · intermediate
Python: Data & Logic
Master list comprehensions, classes, error handling, and data manipulation in Python.
About 35 minutes

Advanced Python Terms
| English | Türkçe |
|---|---|
| classA class is a blueprint for creating objects. | sınıfBir class, nesneler oluşturmak için kullanılan bir taslaktır. |
| methodA method is a function inside a class. | yöntemMetot, bir class'ın içindeki bir fonksiyondur. |
| selfself refers to the current object instance. | kendisiself, o anki nesne örneğini temsil eder. |
| constructorThe constructor __init__ runs when you create an object. | yapıcıKurucu metot olan __init__, bir nesne oluşturduğunda çalışır. |
| exceptionAn exception is an error that stops normal code. | istisnaException (istisna), kodun normal işleyişini durduran bir hatadır. |
| try/excepttry/except catches errors gracefully. | dene/yakalatry/except, hataları programı çökertmeden güzelce yakalar. |
| lambdaA lambda is a small anonymous function. | lambdaLambda, küçük ve isimsiz bir fonksiyondur. |
| comprehensionA list comprehension creates lists in one line. | kavramaList comprehension, tek satırda liste oluşturmanı sağlar. |
| dictionaryA dictionary maps keys to values. | sözlükBir dictionary, anahtarları değerlerle eşleştirir. |
| sortedsorted() returns a new sorted list. | sıralanmışsorted() fonksiyonu, sıralanmış yeni bir liste döndürür. |
Classes in Python

A class is a blueprint for creating objects. Think of it like a template.
class Student:
def __init__(self, name, age):
self.name = name
self.age = age
def greet(self):
return f"Hi, I'm {self.name}"
# Create an object
student = Student("Elif", 15)
print(student.greet()) # Hi, I'm Elif
Key parts:
• __init__ — the constructor, runs when creating an object
• self — refers to the current object
• Methods — functions that belong to the class
Challenge 1: List Comprehension
Challenge 2: Word Frequency Counter
Challenge 3: Student Class
Challenge 4: Error Handling
Challenge 5: Sort with Lambda
Knowledge Check
Now actually practise it
Reading a lesson is the easy half. A free account unlocks the parts that make it stick — listen to every word in a British accent, and use it in a live conversation with James. Your progress is saved and the words come back for review before you forget them.