Skip to content

Beginner · First steps in Python · topic 1 of 50 · 15 min

What programming and Python are

Explanation

Programming means writing exact steps for a computer to follow. Python is a programming language with simple, English-like words, so it is one of the easiest languages to start with. It is also used for real jobs: websites, data analysis, automation and AI.

A program is a list of instructions

A computer is fast but it cannot guess what you want. It only follows instructions, one after another, exactly as written. A list of such instructions is called a program. Writing programs is called programming or coding.

Think of it like this: Think of a recipe for making chai. "Boil water, add tea leaves, add sugar, add milk, boil again, strain." If you skip a step or change the order, the chai goes wrong. A program is a recipe for the computer, and the computer follows it without ever skipping a step.

What is Python?

A programming language is a set of words and rules that both you and the computer understand. Python is one such language. It was created by Guido van Rossum and first released in 1991. Today it is one of the most used languages in the world.

  • Easy to read: Python code looks close to plain English.
  • Free: you never pay to use Python.
  • Used everywhere: Instagram, YouTube and many Indian startups use Python on their servers.
  • Huge library: thousands of ready-made tools for maths, dates, data, web and AI.

Your first line of Python

python
print("Namaste, India!")
print shows text on the screen. Press Run to try it.

When you run this, Python reads the line, sees the word print, and shows the text inside the quotes. The text inside quotes is called a string.

How Python runs your code

  1. You write code in a file or in a box like the one on this page.
  2. A program called the Python interpreter reads your code line by line, from top to bottom.
  3. For each line, it does what the line says, then moves to the next line.
  4. If a line has a mistake, Python stops and shows an error message that tells you the line number.
Tip: On this website Python runs inside your browser. You do not need to install anything to practise. Later, when you want Python on your own computer, download it free from python.org.
Careful: Python is case-sensitive. print and Print are different words to Python. Print("hi") gives an error because Python only knows print in small letters.

What can you build with Python?

AreaExample
AutomationRename 500 photos in one second
WebsitesThe server code behind a shopping site
DataFind the average marks of 2,000 students
AITrain a model that reads handwriting

Watch the lesson

What programming and Python are · 1/7

What is programming?

Welcome to Python. In this lesson you will find out what programming really is, and why Python is a great first language.

Prefer a video by a teacher? Find free videos on “what is python programming for beginners” on YouTube ↗

In real life: A shopkeeper counting stock

Ramesh runs a small kirana shop. Every evening he counts packets of biscuits, rice and oil by hand. A five-line Python program can add the numbers, warn him when something is running low and print a neat list. That is what programming is: writing the steps once so the computer repeats them perfectly every day.

python
print("Biscuits: 24 packets")
print("Rice: 8 bags")
print("Oil: 3 bottles - order more!")
A tiny program that prints a stock list.

Practice (0/2 done)

Task 1 · Code · Python

Write a function called greeting() that returns the text "Hello, Python!" exactly (with the capital letters, comma and exclamation mark).

Task 2 · Code · Python

Write a function called shop_name() that returns the text "Ramesh Kirana Store".

Quick quiz

Question 1

1.What is a program?

Question 2

2.Which line correctly shows Hello on the screen?

Question 3

3.In what order does Python run the lines of a program?

Question 4

4.Which of these is NOT a common use of Python?

Read more (free)

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.