MCQ On Understanding Lists in Python For Class 7
MCQ On Understanding Lists in Python For Class 7
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.
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".
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
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.
import random
print(random.randint(1, 10))
Answer: It will output a random integer between 1 and 10 (inclusive).
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.
Long Questions: (Solve this question by your own in robotics copy and check it from me)
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