School Revise · Class 11 Computer Science · Chapter 5
Code 083, Class 11. Python is simple and readable. Here we run our first programs, print output, store values in variables and meet the basic data types.
|
|
Python lets us instruct the computer in plain, readable words. In this chapter we run Python two ways, print messages, store values in variables, and learn the common data types.
In interactive mode you type one line and see the result at once. In script mode you save many lines in a file and run them together, which is how real programs are written.
The print() function shows output. A variable stores a value, written as name = value. A line beginning with # is a comment, a note for humans that Python ignores.
|
Example: city = “Doha” then print(“I live in”, city) displays: I live in Doha |
Common data types are int (whole numbers), float (decimals), str (text) and bool (True or False). Python picks the type from the value. The input() function reads text typed by the user.
Build tiny programs by tapping and watch Python read each line. The interactive opens right here in the lesson.
Write and run real Python right here in the lesson, then work through the practice problems with answers.
Type each one into the code lab above, then open the card to see the worked solution and its output.
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
print(). For example print(“Hi”) shows Hi.
float, because it has a decimal point.
comment, which Python ignores.
input().
|
Python runs in interactive mode (line by line) or script mode (a saved file). print() shows output, a variable stores a value with name = value, and # marks a comment. Common data types are int, float, str and bool, and input() reads text from the user. |
| Open the Virtual Lab |
These free Class 11 Computer Science notes explain getting started with Python, interactive and script mode, print, variables, comments, data types and input with worked Python programs and practice, for CBSE students across India and the Gulf including the UAE, Saudi Arabia, Qatar, Oman, Kuwait and Bahrain.
© 2026 School Revise. All rights reserved. Original content aligned to the CBSE and NCERT Class 11 Computer Science syllabus. Unauthorised copying is not permitted.