Skip to content
GateShala
PythonCJavaJavaScriptDSAGATE CS Playground
Playground
Python Tutorial

1Getting Started

  • Your First Python Program
  • Variables and Data Types
  • Operators
  • Input and Output

2Control Flow

  • Making Decisions with if
  • Repeating Code with Loops

3Functions

  • Writing Your Own Functions

4Data Structures

  • Working with Strings
  • Lists
  • Tuples and Sets
  • Dictionaries

5Object-Oriented Programming

  • Classes and Objects
  • Inheritance

6Errors and Files

  • Handling Errors
  • Reading and Writing Files
Home/Python

Python Tutorial

Python reads almost like plain English, which makes it a gentle first language. These lessons take you from printing your first line to writing your own functions.

Start the first lesson

1Getting Started

  1. Your First Python ProgramWhat Python is, how to install it, and how to make the computer say hello.
  2. Variables and Data TypesStore values in named boxes and meet Python's basic types.
  3. OperatorsDo arithmetic, compare values and combine conditions.
  4. Input and OutputRead what the user types with input() and format your output neatly.

2Control Flow

  1. Making Decisions with ifRun different code depending on whether a condition is true.
  2. Repeating Code with LoopsUse for and while loops to do the same work many times.

3Functions

  1. Writing Your Own FunctionsPackage code into reusable, named pieces with def.

4Data Structures

  1. Working with StringsIndex, slice, search and transform text.
  2. ListsStore an ordered collection of items and change it as you go.
  3. Tuples and SetsFixed groups of values, and collections without duplicates.
  4. DictionariesStore values by name using key-value pairs.

5Object-Oriented Programming

  1. Classes and ObjectsBundle data and behaviour together by defining your own types.
  2. InheritanceBuild new classes on top of existing ones and override their behaviour.

6Errors and Files

  1. Handling ErrorsCatch exceptions with try and except so your program does not crash.
  2. Reading and Writing FilesSave data to files and read it back with open() and the with statement.
GateShala

Learn to code, one small lesson at a time. All lessons are free to read.

PythonCJavaJavaScriptDSAGATE CSPlayground