Curriculum
Course: Grade XI Informatics Practices
Login
Text lesson

Ch2-Python-Fundamentals

School Revise · Class 11 Informatics Practices · Chapter 2

Python Fundamentals

Code 065, Class 11. Python is a simple, readable language. Here we print output, store values in variables, and meet the basic data types and operators.

4

core data types

2

ways to run Python

What this chapter is about

Python lets us instruct the computer in plain words. We run it interactively or as a script, print output, store values, and use operators.

1. print, variables, comments

print() shows output. A variable stores a value with name = value. A line starting with # is a comment.

city = “Doha” print(“I live in”, city) Output: I live in Doha

2. Data types

Common types are int, float, str and bool. Python chooses the type from the value, and input() reads text from the user.

3. Operators

Arithmetic: + – * / % (remainder) ** (power). Relational: > < == compare values. Logical: and, or, not combine conditions.

Practise with the interactive

Explore the idea by tapping. The interactive opens right here in the lesson.

Try it in the code lab

Write and run real Python right here in the lesson, then work through the practice problems with answers.

Starting Python...

Coding practice problems, with answers

Type each one into the code lab above, then open the card to see the worked solution and its output.

Problem 1. Print a welcome message.

SOLUTION

print(“Welcome to School Revise”)

OUTPUT

Welcome to School Revise
Problem 2. Store two numbers and print their sum.

SOLUTION

a = 5 b = 3 print(a + b)

OUTPUT

8
Problem 3. Ask the user their name and greet them.

SOLUTION

name = input(“Your name: “) print(“Hello,”, name)

OUTPUT

Your name: Ravi Hello, Ravi
Problem 4. Print the data type of 3.14.

SOLUTION

print(type(3.14))

OUTPUT

<class ‘float’>
Problem 5. Find the remainder of 17 divided by 5.

SOLUTION

print(17 % 5)

OUTPUT

2
Problem 6. Find 2 to the power 10.

SOLUTION

print(2 ** 10)

OUTPUT

1024
Problem 7. Check if 8 is greater than 5.

SOLUTION

print(8 > 5)

OUTPUT

True
Problem 8. Convert 20 Celsius to Fahrenheit.

SOLUTION

c = 20 print(c * 9 / 5 + 32)

OUTPUT

68.0
Problem 9. Print the average of 82, 91 and 76.

SOLUTION

print((82 + 91 + 76) / 3)

OUTPUT

83.0
Problem 10. Read two numbers and print their product.

SOLUTION

x = int(input(“x: “)) y = int(input(“y: “)) print(x * y)

OUTPUT

x: 4 y: 6 24

Practice set A, multiple choice

1. Which function shows output?

print().

2. The data type of 3.14 is …

float.

3. What does 17 % 5 give?

2, the remainder.

4. Which function reads user input?

input().

Quick summary

Python runs interactively or as a script. print() shows output, a variable stores a value with name = value, and # marks a comment. Data types are int, float, str and bool. Operators include arithmetic (+ – * / % **), relational (> < ==) and logical (and, or, not). input() reads text from the user.

Open the Virtual Lab

These free Class 11 Informatics Practices notes explain Python fundamentals, print variables and comments, data types, and arithmetic relational and logical operators with worked examples 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 Informatics Practices syllabus. Unauthorised copying is not permitted.

Layer 1
Login Categories