Grade 8 Revision Test 2
Grade 8 Revision Test 2
A) To define a function
B) To create a loop
D) To print a message
C) To define a loop
A) To create a loop
C) To define a function
A) ==
B) =
C) !=
D) >
7. How can you iterate over the elements of a list using a for loop?
D) Continues to the next iteration without executing the rest of the code in the loop
9. When combining if statements and for loops, what is the purpose of the continue statement?
10. In a nested for loop, how can you break out of the inner loop only?
- A) Image recognition
- C) Speech synthesis
- D) Robotics
13. Which AI domain involves creating algorithms that allow machines to learn from data and improve over time
without explicit programming?
- A) Robotics
- B) Expert Systems
- C) Machine Learning
- D) Pattern recognition
16. Which domain involves the study of algorithms that enable computers to make decisions and take actions without
explicit programming?
- B) Robotics
- D) Artificial Intelligence
17. The field of AI concerned with developing machines that can perform tasks requiring human intelligence is known
as:
- A) Machine Learning
- B) Robotics
- D) Expert Systems
19. Which AI domain involves designing systems that can act and react like humans in a real-world environment?
- B) Robotics
- C) Expert Systems
- D) Machine Learning
ANSWER-KEY:
2. for i in range(2,11,2):
print(i)
3. sum=0
for i in range(1,6):
sum+=i
print(“sum:”, sum)
4. for i in range(1,5):
print(i*i)
5. word=”PYTHON”
for char in word:
print(char)