// The most versatile programming language.
PYTHON IS THE LANGUAGE OF POSSIBILITY.
From web development to data science, machine learning to automation, Python powers the modern world. It's readable, powerful, and has the largest ecosystem of libraries of any programming language.
WHY PYTHON?
Python emphasizes code readability with its clean syntax. It runs everywhere, has massive community support, and lets you build anything from simple scripts to complex AI systems.
BECOME A PYTHONISTA.
Learn fundamentals, object-oriented programming, file handling, APIs, and best practices. Join millions of developers who choose Python as their primary language.
12 lessons. Complete Python control.
Learn Python basics, installation, and write your first program.
BeginnerStore and manipulate data with variables, strings, numbers, and booleans.
BeginnerMake decisions with if/else statements and automate with loops.
BeginnerWrite reusable code blocks with parameters and return values.
BeginnerWork with ordered collections and manipulate sequences of data.
BeginnerStore key-value pairs and work with collections of unique items.
IntermediateRead from and write to files, handle CSV and JSON data.
IntermediateCreate classes, objects, and build reusable components with OOP.
IntermediateHandle exceptions gracefully and debug your Python programs.
IntermediateOrganize code across files and import functionality from libraries.
IntermediateFetch data from web services and work with JSON responses.
AdvancedWrite clean, Pythonic code following PEP 8 and best practices.
AdvancedPython was created by Guido van Rossum in 1991 with a philosophy emphasizing code readability. Today, it's the most popular programming language for beginners and experts alike.
Python's versatility is unmatched. Need a web server? Use Flask or Django. Data analysis? Pandas and NumPy have you covered. Machine learning? TensorFlow and PyTorch are industry standards. Automation? Python scripts everything.
The Python Package Index (PyPI) hosts over 350,000 packages. Whatever you want to build, someone has likely already solved the hard problems.
The future of programming is Python. Own it.
Python is a high-level, interpreted programming language created by Guido van Rossum in 1991. Its design philosophy emphasizes code readability and simplicity.
Python uses indentation to define code blocks, not braces or keywords:
1. Python was created by _____ in 1991.
Hint: Dutch programmer
2. Python is a _____ language.
Hint: Not compiled
3. To print, use the _____ function.
Hint: Built-in function
4. Python uses _____ to define code blocks.
Hint: Whitespace
5. The command to run Python is _____.
Hint: In terminal
6. import _____ shows Python philosophy.
Hint: Easter egg
7. Python emphasizes code _____.
Hint: Easy to read
8. PEP stands for Python _____ Proposal.
Hint: Improvement
Variables are containers for storing data values. In Python, you don't need to declare variable types.
1. Variables store _____ values.
Hint: Information
2. Strings use _____ quotes.
Hint: \
3. The type() function returns the _____.
Hint: Type of variable
4. int() converts to _____.
Hint: Whole number
5. Boolean values are _____ and False.
Hint: Capital T
6. Variables cannot be Python _____.
Hint: Reserved words
7. float() converts to _____ number.
Hint: With decimal
8. Python is _____ typed.
Hint: No declaration needed
Use if, elif, and else to make decisions in your code.
1. Use _____ for decisions in code.
Hint: Conditional
2. == means _____ comparison.
Hint: Equal to
3. _____ continues to next iteration.
Hint: Skip
4. range(5) produces _____ numbers.
Hint: Five numbers
5. while True needs _____ to exit.
Hint: Exit condition
6. elif is short for else _____ .
Hint: Else if
7. pass is a _____ statement.
Hint: Do nothing
8. or returns True if _____ is True.
Hint: At least one
Functions are reusable blocks of code that perform a specific task.
Small anonymous functions:
1. Use _____ to define a function.
Hint: Keyword
2. return sends a _____ back.
Hint: Result
3. Parameters with defaults go at the _____.
Hint: Last
4. *args handles variable _____ arguments.
Hint: Non-keyword
5. **kwargs handles variable _____ arguments.
Hint: Named
6. Lambda functions are _____.
Hint: No name
7. map() applies function to each _____ in iterable.
Hint: Item
8. filter() keeps elements matching _____.
Hint: True condition
Lists are ordered, mutable collections that can hold items of any type.
Tuples are ordered, immutable collections.
1. Lists are _____ (can be changed).
Hint: Changeable
2. Tuples are _____ (cannot be changed).
Hint: Unchangeable
3. Use _____ to add to end of list.
Hint: Add method
4. index() returns the _____ of element.
Hint: Location
5. pop() removes and _____ the last element.
Hint: Sends back
6. List comprehensions use square _____.
Hint: []
7. Negative index accesses from the _____.
Hint: Last
8. count() returns number of _____.
Hint: How many
Dictionaries store key-value pairs. They're unordered, mutable, and indexed by keys.
Sets are unordered, mutable collections of unique elements.
1. Dictionaries store _____ pairs.
Hint: Keys and values
2. Use get() to safely access _____.
Hint: With default
3. pop() removes and _____ a key-value pair.
Hint: Sends back
4. Sets store only _____ elements.
Hint: No duplicates
5. & (ampersand) performs _____ operation.
Hint: Common elements
6. | performs _____ operation.
Hint: All elements
7. discard() removes without _____ if missing.
Hint: No
8. items exception() returns _____ pairs.
Hint: Tuples
1. Use open() with mode _____ for reading.
Hint: Read mode
2. with statement ensures file is _____.
Hint: Auto-closed
3. mode _____ overwrites the file.
Hint: Write mode
4. JSON stores data as _____.
Hint: Human-readable
5. csv module handles _____ files.
Hint: CSV format
6. Path from pathlib represents _____.
Hint: File/directory
7. strip() removes _____ from strings.
Hint: Newlines, spaces
8. dump() writes _____ to file.
Hint: JSON data
Using private attributes (prefixed with _ or __):
1. __init__ is called when _____ object.
Hint: Instantiation
2. self refers to the _____.
Hint: Current object
3. Inheritance creates a child-_____ relationship.
Hint: Base class
4. __balance uses _____ encapsulation.
Hint: Double underscore
5. @classmethod receives _____ as first argument.
Hint: Class
6. @property creates a _____.
Hint: Computed attribute
7. __str__ defines _____ representation.
Hint: str() output
8. Static methods don
Hint: Instance
1. Try-except handles _____.
Hint: Errors
2. except catches specific _____ type.
Hint: Exception
3. _____ runs if no exception occurred.
Hint: After try
4. _____ always runs.
Hint: Always executes
5. raise creates an _____.
Hint: Error
6. Custom exceptions inherit from _____.
Hint: Base class
7. ValueError is for invalid _____.
Hint: Wrong value
8. as e stores exception in _____.
Hint: Reference
1. pip installs _____.
Hint: Libraries
2. Virtual environments keep dependencies _____.
Hint: Separate
3. activate script is in _____ folder.
Hint: Scripts on Windows
4. from module _____ imports specific items.
Hint: Select
5. as creates an _____.
Hint: Nickname
6. requirements.txt lists _____ versions.
Hint: Dependencies
7. freeze saves current _____.
Hint: Installed libs
8. __init__.py makes folder a _____.
Hint: Importable
1. requests.get() makes _____ requests.
Hint: Retrieve
2. status_code 200 means _____.
Hint: OK
3. JSON method parses response _____.
Hint: Content
4. params argument adds _____ parameters.
Hint: URL parameters
5. raise_for_status() raises for _____ codes.
Hint: 4xx/5xx
6. timeout limits _____ time.
Hint: Seconds
7. POST creates new _____.
Hint: Data
8. Authorization header sends _____.
Hint: Token/password
1. PEP 8 is the Python _____.
Hint: Code standards
2. Use _____ spaces per indentation.
Hint: PEP 8
3. Docstrings document _____.
Hint: Code
4. Type hints specify _____ types.
Hint: Expected
5. unittest is Python
Hint: Unit tests
6. _____ environments isolate dependencies.
Hint: venv
7. __pycache__ should be in _____.
Hint: Not tracked
8. logging module provides _____ logging.
Hint: Standard lib