- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AINeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
Python Basics
Learn Python collections, loops, functions, classes, exceptions, JSON, and other core language features with runnable examples.
Run Python Basics online22 lessons
Variables and Data Types in Python
Store values in variables and learn Python's basic types: str, int, float and bool.
View example →Numbers and Operators in Python
Do arithmetic in Python with +, -, *, /, //, % and **, and compare values.
View example →User Input in Python
Read what the user types with input() and convert it to a number.
View example →If Else in Python
Make decisions with if, elif and else, and combine conditions with and, or and not.
View example →For Loop in Python
Learn Python for loops with range, enumerate, and a runnable example.
View example →While Loop in Python
Run a Python while loop and learn how its condition controls repetition.
View example →Strings in Python
Work with text in Python: length, indexing, slicing and string methods.
View example →String Formatting in Python
Build readable output with Python f-strings and format specifiers.
View example →Tuple in Python
Group values in a tuple, unpack them and return several values from a function.
View example →Set in Python
Keep unique values with a Python set and combine sets with union and intersection.
View example →Function in Python
Define and call a Python function with parameters and a return value.
View example →Modules and Imports in Python
Use Python's standard library with import, from ... import and aliases.
View example →List Comprehension in Python
Transform and filter values with a Python list comprehension.
View example →Merge Dictionaries in Python
Merge Python dictionaries with the modern union operator.
View example →File Handling in Python
Write, append and read text files in Python with open() and with.
View example →Class and Object in Python
Define a Python class, create an object, and call an instance method.
View example →Object-Oriented Programming in Python
Learn encapsulation, inheritance, method overriding, and polymorphism with a runnable Python OOP example.
View example →