HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Python Programming
  2. /Python Basics
  3. /Getting Started with Python

Getting Started with Python

Python Programming · Middle Stage (6–8) · 2 courses, 28 worked problems, 40 practice questions

Python is a programming language that reads almost like English, which makes it a good first language. A program is a list of instructions that the computer carries out in order. On this site you type code in the editor and press Run to see the result. A first program can be one line: print("Hello"). Python can also act as a calculator, so print(3 * 4) shows 12. Comments start with # and are notes for people, not for the computer. Errors are normal, and the message Python gives tells you what to fix.

With practice you will be able to

  • Write and run a program that prints a message
  • Use Python as a calculator for simple arithmetic
  • Add comments and read a simple error message

On the syllabus of

  • CBSE / State Class 12
  • Python Certification

Lessons

  • Say Hello to PythonWhen does print() work out a sum? What does an error message tell you?Middle Stage (6–8)
  • Install and Run Python at HomeDo you need to install Python to learn it? Why does Windows say python is not recognized?Middle Stage (6–8)

Practice questions

Choose an answer, then check it. Each one shows a full explanation.

A text is repeated with the star. What does print("ab" * 3) show?

A label and a sum in one print(): what does print("Total:", 2 + 5) show?

Which of these lines has a mistake?

A program has the comment # Say hello on line 1 and print("Hello") on line 2. How many lines does it show?

Worked problems

Each one has a hint, the key idea and a full worked solution.

  • Predict the outputEasy
  • Three programs are shown. For each one, name the kind of error that Python will show (NameError or…Easy
  • Write a program that prints a box of stars, 4 lines tall and 12 characters wide…Medium
  • A student has an old laptop with Windows 7, 4 gigabytes of memory, and no internet at home…Easy
  • Write the command that checks the version of Python in a terminal, for (a) Windows with the Python…Easy

Python labs

  • Say it with print()
  • Fix the three bugs
  • Sum or text?
  • Separators and endings
  • Project: the name card
  • Read the version

Related topics

  • Python Basics
  • Variables and Data Types
  • Operators and Expressions
  • Input and Output
  • Strings
  • Conditionals: if, elif, else
  • Loops
  • Lists
  • Functions
  • Mini Projects

Which terminal command goes up one folder?

You run python3 card.py in a terminal, and the program uses input(). How do you answer its question?

Which of these is a good name for a Python file?

A student types print("Hi") straight into the terminal, not inside Python, and gets an error. What is the mistake?

What does print("Hi", "there") show?

What does print(3 + 4) show?

All 40 practice questions on Getting Started with Python →

A student saves a program as my first program.py.txt, opens a terminal, types python my first…Medium
  • Which part of the code box (the code, Run, Reset, Copy, the Input box or the output) do you use to…Easy
  • Change the program below so that it shows your own name in the first line, and then add a second…Easy
  • Write a program that shows Hello, Python! on one line and My name is Ravi. on the next line.Easy
  • What does each line show?Easy
  • Print a staircase with four steps. The first line has one star, the second has two, and so on.Easy
  • Each line has one mistake. Find it and write the correct line.Medium
  • All 28 worked problems on Getting Started with Python →