0% found this document useful (0 votes)
20 views5 pages

Grade 8 Revision Test 2

The document is a Grade 8 revision test for Computer Science, covering topics such as conditional statements, loops, and artificial intelligence domains. It includes multiple-choice questions and code output exercises related to Python programming. An answer key is provided at the end for reference.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views5 pages

Grade 8 Revision Test 2

The document is a Grade 8 revision test for Computer Science, covering topics such as conditional statements, loops, and artificial intelligence domains. It includes multiple-choice questions and code output exercises related to Python programming. An answer key is provided at the end for reference.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Grade 8 Revision Test-Computer Science

1. What is the purpose of an if statement in Python?

A) To define a function

B) To create a loop

C) To execute a block of code conditionally

D) To print a message

2. In Python, how is the else statement used with an if statement?

A) To create a nested if statement

B) To execute code only if the if condition is False

C) To define a loop

D) To break out of a loop

3. What is the purpose of the elif statement in Python?

A) To create a loop

B) To execute code only if the if condition is True

C) To define a function

D) To specify an additional condition if the initial if condition is False

4. Which operator is used for checking equality in an if statement?

A) ==

B) =

C) !=

D) >

5. How is a for loop different from a while loop in Python?

A) for loops can only iterate over numbers

B) for loops are used for a specific number of iterations

C) for loops cannot be nested

D) for loops do not use the range function

6. What is the purpose of the range function in a for loop?

A) To define a range of numbers to iterate over


B) To create a nested loop

C) To check for loop conditions

D) To break out of a loop

7. How can you iterate over the elements of a list using a for loop?

A) Using the while loop

B) Using the in keyword

C) Using the for each keyword

D) Using the repeat function

8. What does the break statement do in a for loop?

A) Skips the current iteration and moves to the next one

B) Exits the loop completely

C) Creates an infinite 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?

A) To exit the loop completely

B) To skip the current iteration and move to the next one

C) To check for loop conditions

D) To create a nested loop

10. In a nested for loop, how can you break out of the inner loop only?

A) Using the break statement

B) Using the continue statement

C) Using the pass statement

D) Using a return statement

11. Natural Language Processing (NLP) is a subdomain of AI that focuses on:

- A) Image recognition

- B) Understanding and processing human language

- C) Speech synthesis

- D) Robotics

12. Computer Vision in AI is concerned with:

- A) Simulating human vision

- B) Understanding and interpreting visual information from the world

- C) Generating random images


- D) Enhancing computer performance

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) Natural Language Processing

14. Expert Systems in AI are designed to:

- A) Mimic human decision-making in specific domains

- B) Recognize objects in images

- C) Process natural language

- D) Perform physical tasks

15. Reinforcement Learning in AI is closely related to:

- A) Learning from labeled datasets

- B) Learning by trial and error

- C) Mimicking human behavior

- D) Pattern recognition

16. Which domain involves the study of algorithms that enable computers to make decisions and take actions without
explicit programming?

- A) Natural Language Processing

- B) Robotics

- C) Decision Support Systems

- 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

- C) Artificial General Intelligence (AGI)

- D) Expert Systems

18. In AI, the term "Computer Audition" refers to:

- A) Analyzing and interpreting music

- B) Recognizing and understanding sounds

- C) Creating computer-generated speech


- D) Developing auditory sensors for robots

19. Which AI domain involves designing systems that can act and react like humans in a real-world environment?

- A) Natural Language Processing

- B) Robotics

- C) Expert Systems

- D) Machine Learning

20. Semantic Web in AI is focused on:

- A) Creating realistic 3D environments for virtual reality

- B) Improving web search by understanding the meaning of information

- C) Developing algorithms for image processing

- D) Simulating human reasoning in games

ANSWER-KEY:

1 C) To execute a block of code conditionally


2 B) To execute code only if the if condition is False
3 D) To specify an additional condition if the initial if condition is False
4 A) ==
5 B) for loops are used for a specific number of iterations
6 A) To define a range of numbers to iterate over
7 B) Using the in keyword
8 B) Exits the loop completely
9 B) To skip the current iteration and move to the next one
10 A) Using the break statement
11 B) Understanding and processing human language
12 B) Understanding and interpreting visual information from the world
13 C) Machine Learning
14 A) Mimic human decision-making in specific domains
15 B) Learning by trial and error
16 D) Artificial Intelligence
17 C) Artificial General Intelligence (AGI)
18 B) Recognizing and understanding sounds
19 B) Robotics
20 B) Improving web search by understanding the meaning of information
Find the output of the following codes:
1. for i in range(5):
print(i)

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)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy