0% found this document useful (0 votes)
136 views

MCQ On Understanding Lists in Python For Class 7

Uploaded by

shilpashaw216
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views

MCQ On Understanding Lists in Python For Class 7

Uploaded by

shilpashaw216
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

MCQ on Understanding Lists in Python for Class 7 (with Answers and Explanations)

Multiple Choice Questions

1. What is a list in Python?


a. A collection of numbers
b. A sequence of characters
c. An ordered collection of items
d. A dictionary of key-value pairs
Explanation: Lists in Python are ordered collections that can store elements
of different data types.

2. How do you create an empty list in Python?


a. list()
b. []
c. {}
d. ()

Explanation: The empty list is represented by square brackets [].


3. What is a module in Python?
a. A type of variable
b. A file containing Python code
c. A function that runs in the background
d. A part of a computer's hardware
Explanation: A module is a file that contains Python definitions and statements. It
can include functions, classes, and variables, making it a way to organize code.

4. Which of the following is a way to import a module in Python?


a. include module_name
b. import module_name
c. using module_name
d. require module_name
Explanation: The import statement is used to bring a module into your code so you
can use its functions and variables.

5. What is the purpose of decision-making statements in Python?


a. To repeat a block of code
b. To handle errors in code
c. To execute code based on conditions
d. To define functions
e. Answer: C) To execute code based on conditions
Explanation: Decision-making statements, like if, elif, and else, allow the
program to execute specific blocks of code depending on whether a condition
is true or false.
6. What will be the output of the following code?
x = 10
if x > 5:
print("Hello")
a. Hello
b. 10
c. Error
d. Nothing
Answer: A) Hello
Explanation: Since x (10) is greater than 5, the condition is true, and "Hello"
will be printed.

7. What will the following code output?


age = 15
if age < 13:
print("Child")
elif age < 20:
print("Teenager")
else:
print("Adult")
a. Child
b. Teenager
c. Adult
d. Error
Answer: B) Teenager
Explanation: The age is 15, which is not less than 13 but is less than 20, so
"Teenager" will be printed.

8. What will the following code print?


number = 10
if number % 2 == 0:
print("Even")
else:
print("Odd")

a. Even
b. Odd
c. Error
d. Nothing
Answer: A) Even
Explanation: The code checks if number is even (i.e., divisible by 2). Since
10 is even, "Even" is printed.

9. If the voltage across a resistor is 12 volts and the resistance is 4 ohms, what is the current
flowing through the resistor?
a. 3 Amperes
b. 48 Amperes
c. 16 Amperes
d. 0.33 Amperes
Answer: A) 3 Amperes
Explanation: Using Ohm's Law,
𝑣=𝑖𝑥𝑟
𝑣
𝑖=
𝑟
12
𝑖=
4
𝑖 = 3 𝑎𝑚𝑝𝑒𝑟𝑒

10. What colour represents the number 2 in the resistor colour code?
a. Red
b. Blue
c. Green
d. Brown
Answer: A) Red
Explanation: The resistor colour code uses colours to indicate numbers: Red
represents 2, while other colours represent different values.

11. Which of the following materials is commonly used to make resistors?


a. Copper
b. Rubber
c. Carbon
d. Plastic
Answer: C) Carbon
Explanation: Carbon is commonly used in resistors because it has good
resistive properties and is relatively inexpensive.

12. What happens to the brightness of a bulb in a circuit if a resistor is added?


a. It becomes brighter
b. It becomes dimmer
c. It goes out completely
d. It stays the same
Answer: B) It becomes dimmer
Explanation: Adding a resistor increases the total resistance in the circuit,
which reduces the current flowing to the bulb, making it dimmer.

13. What does the following code return?


def add_numbers(a, b):
return a + b

result = add_numbers(3, 4)
print(result)
a. 34
b. 7
c. 12
d. 0
Answer: B) 7
Explanation: The function add_numbers returns the sum of a and b, which is
7 in this case.
14. What does the following code do?
colors = ["red", "blue", "green"]
print(colors[1])
a. red
b. blue
c. green
d. Error
Answer: B) blue
Explanation: Lists in Python are zero-indexed, so colors[1] refers to the
second element, which is "blue".

15. What does this code return?


def square(x):
return x * x

result = square(5)
print(result)
a. 10
b. 15
c. 25
d. 5
Answer: C) 25
Explanation: The function square returns the square of the input, which is
5×5=25.

Reasoning Questions

1. What is a module in Python?

Answer: A module is a file that contains Python code, which can include functions,
classes, and variables. It allows you to organize your code and reuse it in different
programs.

2. Which function in the random module generates a random integer between two specified
numbers?

Answer: The randint(a, b) function generates a random integer between a and b, inclusive.

3. What will the following code output?

import random
print(random.randint(1, 10))
Answer: It will output a random integer between 1 and 10 (inclusive).

4. What is the output of this code?

temperature = 30
if temperature > 25:
print("It's hot!")
else:
print("It's cool!")
Answer: It will print "It's hot!" because the temperature is greater than 25.

5. What is the unit of resistance?

Answer: The unit of resistance is Ohm, represented by the symbol Ω

Long Questions: (Solve this question by your own in robotics copy and check it from me)

1. Find the value of resistance in following resistor

2. A light bulb has a resistance of 6 Ω. If the current flowing through it is 0.5 A,


what is the voltage across the light bulb?

3. A circuit has two points, A and B. The voltage at point A is 15 V and at point B is
5 V. What is the voltage difference between points A and B? If a resistor of 3 Ω
is connected between these points, what is the current flowing through the
resistor?

4. Write a program to import random module and print the random number
between 1 – 100.

5. Write a program to check whether the person is eligible for voter id card using
function declaration

6. Find the total capacitance of the following series?

You might also like