+91 81900 98289

Python Overview

This Python Overview lesson is for a beginner. Read the short notes, run each example, then change one name or number and run it again.

This reference group lists the built-in tools the lessons use, without walking through each topic again.

Use the tutorial menu when you want the explanation. Use these pages when you want the name of a function or a method.

Example 1: Start here

The full list of built-ins is in the Python documentation. These pages keep the ones a first course needs.

print(len(["Python", "SQL"])) # len counts the items print(abs(-3))

Example 2: Store the idea in a name

Python Overview begins with a value you can point at. The name topic holds that text.

topic = "Python Overview" # text print(topic)

Example 3: Check it with if

An if chooses one branch. Change the score and run it again to see the other message.

score = 19 # a whole number if score >= 80: # run the indented lines only when this is true print("Pass") else: # runs when the test above was false print("Try again")

Example 4: Repeat with a loop

A for loop runs the indented line once per step. The numbers 1, 2, and 3 are printed on their own lines.

for step in range(1, 4): # repeat once per number; range stops before the last print("Step", step) # a comma prints each value, with a space between
The full list of built-ins is in the Python documentation. These pages keep the ones a first course needs.
Call Now 81900 98289