Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    PyPython

    Getting started

    • Your first Python program
    • Variables and types
    • Numbers and operators
    • Type conversion and input

    Strings

    • Strings and f-strings
    • String indexing and slicing
    • Cleaning and splitting strings

    Control flow

    • Conditions: if, elif and else
    • Loops: for and while
    • Loop control and nesting

    Functions

    • Functions with def
    • Parameters and scope

    Collections

    • Lists
    • Dictionaries
    • Tuples and sets
    • Comprehensions, enumerate and zip

    Errors, files and libraries

    • Handling exceptions
    • Modules and the standard library
    • Reading and writing files
    • Exchanging data with JSON

    Objects and lazy iteration

    • Classes and objects
    • Inheritance and composition
    • Iterators and generators

    Testing and project

    • Testing and project setup
    • Project: a grade report
    Python

    Getting started · Lesson 1 of 25

    Your first Python program

    What Python is used for, print, and comments.

    6 minutes3 games

    Python is one of the easiest languages to read: it looks close to English, and indentation (spaces at the start of a line) is part of the code instead of brackets. It's used for AI, data analysis, websites (Django, Flask), automation and scripts, and as a first language at universities.

    You write hello.py

    The interpreter reads it line by line

    The output appears

    print() prints whatever is inside it and moves to a new line. A line starting with # is a comment: Python ignores it; it's for people reading the code.

    Python
    # This is a comment
    print("Hello, SeaCode!")
    print(7 * 6)
    print("Python", "is", "fun")
    print("a", "b", "c", sep="-")
    print("no new line", end=" | ")
    print("same line")

    The first run can take a few seconds while the runner wakes up.

    sep changes the separator between values (a space by default); end changes how the line ends (a new line by default).

    Important

    Python 2 ended in 2020. Everything you write or read today is Python 3, where print is a function that needs brackets: print("hi"), not print "hi".

    Interview question

    Is Python compiled or interpreted?

    What's the output?

    print("A", "B")
    print(2 + 3)

    What will this code print?

    What's the output?

    print(1, 2, 3, sep="+")

    What will this code print?

    Exercise

    Print I am learning Python.

    Expected output: I am learning Python

    Python
    # Write your code here
    

    Learn more from

    • The Python Tutorial: An Informal Introductiondocs.python.org
    • Python docs: print()docs.python.org
    • Real Python: Your Guide to the Python print() Functionrealpython.com

    Played 0 of 3 games

    Sign in to save your progress and earn XP.

    NextVariables and types
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.