0% found this document useful (0 votes)
2 views6 pages

Introduction to Python Question Bank

This document is a question bank for 7th-grade students at Delhi Public School, Srinagar, focusing on Python programming. It includes multiple-choice questions, fill-in-the-blanks, true or false statements, syntax-based questions, output-based questions, and error identification tasks. The content covers fundamental concepts of Python programming, including functions, operators, and conditional statements.

Uploaded by

SheikhKhalidAli
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Introduction to Python Question Bank

This document is a question bank for 7th-grade students at Delhi Public School, Srinagar, focusing on Python programming. It includes multiple-choice questions, fill-in-the-blanks, true or false statements, syntax-based questions, output-based questions, and error identification tasks. The content covers fundamental concepts of Python programming, including functions, operators, and conditional statements.

Uploaded by

SheikhKhalidAli
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DELHI PUBLIC SCHOOL, SRINAGAR

Question Bank.
Chapter: Introduction to Python Programming
Subject: Information Technology
Class: 7th
Name of the Student: _________________________ SID/Roll No. /Section: _______________

A. Multiple choice questions.


1. Which of the following is a programming language?
a) Python
b) HTML
c) CSS
d) Excel

2. Which function is used to take input from the user?


a) print()
b) input()
c) sqrt()
d) show()

3. Which function is used to display output on the screen?


a) input()
b) display()
c) print()
d) scan()

4. Which symbol is used for multiplication in Python?


a) +
b) *
c) /
d) %

5. Which operator is used for power/exponent?


a) //
b) **
c) ==
d) &&

6. Which of the following is a Python keyword?


a) loop
b) number
c) if
d) Int

7. Which module contains mathematical functions?


a) game
b) math
c) random
d) editor
8. Which function is used to calculate square root?
a) root()
b) sqrt()
c) square()
d) sq()

9. Which statement is used for decision making?


a) print
b) if
c) input
d) import

10. Which statement runs when the condition is false?


a) if
b) else
c) print
d) while

11. Which symbol is used to assign a value to a variable?


a) ==
b) =
c) +
d) *
12. Which of the following stores information in Python?
a) Variable
b) Keyword
c) Editor
d) Module

13. Which keyword is used to check another condition?


a) elif
b) print
c) sqrt
d) import

Fill in the Blanks.

1. Python is a programming language.


2. The input function accepts values from the user.
3. The print function displays output on the screen.
4. Information in Python is stored inside variable.
5. The math module contains mathematical functions.
6. The square root function is written as sqrt().
7. Conditional statements help computers make decisions.
8. The operator used for multiplication is *
9. The operator used for power is **.
10. A collection of predefined code is called a builtin function.
11. The if block runs when the condition is true
12. The else block runs when the condition is false.
13. Python keywords have predefined meaning.
14. The keyword used to check multiple conditions is if-elif.
15. The math module must be imported before using sqrt().
True or False
1. Python is a programming language. True
2. print() is used to take input from the user. False
3. input() accepts values from the user. True
4. Variables are used to store information. True
5. sqrt() is used to calculate square root. True
6. Libraries contain predefined code. True
7. Conditional statements are used for decision making. True
8. If statements work only in mathematics. False
9. The else block runs when the condition is false. True
10. ** is used for power in Python. True
11. * is used for multiplication. True
12. Python keywords have predefined meanings. True
13. print("Hello") displays Hello on the screen. True
14. The math module contains mathematical functions. True
15. elif is used to check another condition. True
16. Variables cannot store numbers. False
Syntax based questions.
1. Write the syntax to take input from the user.
x = input(“enter the number”)
2. Write the syntax to take a user's name as input.
name = input("Enter your name: ")
3. Write the syntax to take an integer input from the user.
num = int(input("Enter a number: "))
4. Write the syntax to take a decimal number as input.
num = float(input("Enter a decimal number: "))
5. Write the syntax to print "Hello World".
print("Hello World")
6. 7. Write the syntax to print the value of variable age.
print (age)
7. Write the syntax to print "My name is Rahul".
print("My name is Rahul")
8. 9. Write the syntax to print two variables a and b.
print(a, b)
9. 10. Write the syntax to print the result of addition of two numbers.
print(a + b)
10. Write the syntax to create an integer variable.
x = 10
11. Write the syntax to create a float variable.
x = 10.5
12. Write the syntax to create a string variable.
name = "Aman"
13. Write the syntax to create a variable named city with value "Delhi".
city = "Delhi"
14. Write the syntax to store value 100 in variable marks.
marks = 100
15. Write the syntax to assign multiple values to variables x, y, and z.
x, y, z = 1, 2, 3
16. 21. Write the syntax for addition of two variables a and b.
a+b
17. 22. Write the syntax for subtraction.
a–b
18. Write the syntax of an if statement.
if x > 0:
print("Positive")
19. Write the syntax of an if-else statement.
if x > 0:
print("Positive")
else:
print("Negative")
20. Write a syntax to check if a number is positive.
if num > 0:
print("Positive")
21. Write the syntax to check whether a person is eligible to vote or not.
age = int(input("Enter age: "))
if age >= 18:
print("Eligible to vote")
else:
print("Not eligible")
22. Write the syntax to check:
If marks are greater than 90 → print "Excellent"
if marks > 90:
print("Excellent")
23. Write the syntax to compare two numbers and print the greater number.
if a > b:
print(a)
else:
print(b)
Output based questions.

1. print("Hello World")

Answer: Hello World

2. x = 10
print(x)
Answer: 10

3. a = 5
b=3
print(a + b)
Answer: 8

4. name = "Ali"
print("My name is", name)
Answer: My name is Ali
5. x = 15
y=5
print(x - y)
Answer: 10
6. x = 4
y=2
print(x * y)
Answer: 8

7. x = 20
y=4
print(x / y)
Answer: 5.0
8. marks = 85
if marks >= 80:
print("A Grade")
else:
print("B Grade")
Answer: A Grade

9. x = 10
if x > 0:
print("Positive")
elif x == 0:
print("Zero")
else:
print("Negative")
Answer: Positive

Identify the errors in the following statements.

1. print"Hello World"
Missing parentheses in print() Correct code:print(“Hello world”)

2. Print("Python")

Print should be print Correct code: print (“python”)

3. name = input"Enter your name: "

Missing parentheses after input Correct code: name = input("Enter your name: ")

4. age = int(input("Enter age:")


Missing closing parenthesis Correct code: age = int(input("Enter age:"))

5. x = 10
y = 20
print(x+y
Missing closing parenthesis in print Correct code:print (x+y)

6. if x > 5
print("Greater")

7. Missing colon (:) Correct code: if x > 5:


print("Greater")

You might also like