Computer Science Ics Part 1 Chapter 2 Online Test With Answers

Computer Science Ics Part 1 Chapter 2 Online Test

Sr. # Questions Answers Choice
1

How mode is used to overwite a file

<p>read (r)</p> <p>Write (w)</p> <p>append (a)</p> <p>excute (x)</p>
2

What does the with statemetn do when handling files.

<p>Keeps the file open</p> <p>Ensures the file is closed</p> <p>Delects the file</p> <p>Reades the file</p>
3

What happens in the exceptblock.

<p>Code execution stops</p> <p>Handles the error</p> <p>Creates a new file</p> <p>Compiles the code</p>
4

What does the try block do?

<p>Catches errors</p> <p>Test code for errors</p> <p>Terminates the program</p> <p>Writes to files</p>
5

How does OOP make code scalable

<p>One class only</p> <p>Easy modifications</p> <p>Fewer objects</p> <p>Avoids functions</p>
6

Which OOP principle allows code reuse.

<p>Encapsulation&nbsp;</p> <p>Inheritance</p> <p>Polymorphism</p> <p>All</p>
7

What does ‘self’ represent?

<p>Global variable</p> <p>The class</p> <p>Instanceof the class</p> <p>Built -in function</p>
8

What does the describe() method do?

<p>Initializes the object</p> <p>Describes he toy car</p> <p>Creates a toy car</p> <p>Modifies attributes</p>
9

What does the ‘______ init________’ method do.

<p>Defines a class</p> <p>Initializes attributes</p> <p>Creates a class</p> <p>Deletes an object</p>
10

How does OOP help incode management.

<p>Complicates code</p> <p>Organizes into classes</p> <p>Reduces reuse</p> <p>Eliminates functions</p>
11

What is an object in Python.

<p>Instance of a class</p> <p>Template for classes</p> <p>Type of variable</p> <p>Build -in function</p>
12

What is Object -Oriented programming (OOP)?

<p>Code with functions</p> <p>Code with classes and objects</p> <p>Single file coding</p> <p>Procedural programming</p>
13

What is a key advantage of using modules.

<p>Harder to read</p> <p>Easier maintenance</p> <p>No comments</p> <p>Fewer functions</p>
14

What does breaking a program into modules promote.

<p>Code duplication&nbsp;</p> <p>Code reuse</p> <p>Increased complexity</p> <p>Longer development</p>
15

How does the standard library help programmers.

<p>Complex algorithms</p> <p>Pre built solutions</p> <p>More coding</p> <p>Limited functionality</p>
Download This Set

Is this page helpful?