ITSE 2421

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which of the following symbols is used in a documentation string

" " "

Which of the following statements allows users to execute a block of code if a condition is true?

"If"

Which of the following symbols is used to block start a comment?

#

Which of the following extensions is used for data files?

.CSV

Which of the following is a valid file extension of python scripts?

.py

Which of the following is true about a control statement?

1. It allows users to execute a block of code if a condition is true. 2. It allows users to execute a block of code repeatedly as long as a condition remains true. 3. It is a structure in code than conditionally changes the program flow.

Which of the following statements is true about tuples?

A tuple is immutable

Which of the following imports uses the full path from a project to the module being imported?

Absolute

Which of the following methods is used to add a value to the end of a list?

Append()

Which of the following types of arrays is referred to as a dictionary in Python?

Associative

Which of the following is a fundamental building block of the object-oriented programming (OOP)?

Class

Which of the following statements is executed in the "while" statement when the condition is no longer true?

Else

Which of the following errors occurs when a program is running?

Exception

Which of the following statements is true regarding the difference between exceptions and errors?

Exceptions are errors that occur when a program is running, whereas errors, for example, syntax errors, occur before program execution happens.

In python which of the following strings is used during string interpolation?

F-strings

Which of the following methods is used to return objects?

Factory

Which of the following keywords defines a code block that must be executed before the try...except block exits?

Finally

Which of the following options is referred to as the "for" loop in python?

For---in

The hiding of the ______________ state of an object is referred to as information hiding.

Internal

Which of the following statements is true regarding the finally keyword?

It defines a code block that must execute before the try...except block exits irrespective of whether an exception occurred.

Which of the following statements is true about program flow?

It describes a way in which statements in code are executed

Which of the following statements is correct about a python Module?

It is a file containing python instructions

Which of the following statements is true about inheritance

It is a mechanism that allows the implementation of a class to be derived of the implementation of another class

Which of the following is correct about a class attribute?

It is shared by all instances as opposed to being bound to each instance

Which of the following statements is correct about encapsulation?

It is the bundling of data with methods that operate on that data

Which of the following are the advantages of object-oriented programming (OOP)?

It makes the code reusable, It makes code easier to test, debug, and maintain, and it makes the data secure due to abstraction and data hiding

Which of the following statements is correct about syntax error?

It shows instructions are invalid

Which of the following is also called arrays in other program languages?

List

Which of the following methods removes an item at the given index of a list and returns it?

List.pop([index])

Which of the following programming paradigms makes code reusable and supports abstraction and data hiding?

Object-Oriented Programming (OOP)

In Python which of the following order of operations is used to evaluate operators when evaluating an expression?

PEMDAS

Which of the following is defined as a collection of modules?

Package

Which of the following attributes should only be used inside the class definition and shouldn't be accessed externally?

Private

In which of the following attributes is the is the attribute name prefixed with a single underscore (_)?

Protected

All Python attributes are ______ by default and need no special naming or declaration.

Public

Which of the following imports uses the path from the current directory to the directory where a module is placed?

Relative

Which of the following aspects are needed for defensive programming?

Security, safety, and highly available

Which of the following types of brackets is used in a list?

Square brackets " [ ] "

Which of the following parameters are used in the range function

Stop, Start, and Step.

Which of the following methods is used to add a value to the end of a list?

Syntax error

Which of the following is also called a stack trace?

Traceback

Which of the following quotes are used for enclosing multiline strings?

Triple single and Triple double

The scenario when the code does not execute as intended is called Error.

True

How many arguments does the is instance() function take?

Two

How many arguments the setdefault() method takes?

Two

Which of the following graphs is used to represent an intersection

Venn Diagram

Which of the following is used to write binary numbers in python?

bin() and " Ob "

Which of the following is true about a set?

it is a collection of data items that are unordered and unique

Which of the following methods does not return a new list, only modifies the original?

list.append(item)

Which of the following modes is a combined special mode for working with binary file objects?

rb+

In python which of the following methods is used to return a copy of the string with the leading and trailing characters removed?

str.strip()

Which of the following modes is used to write in a binary file?

wb


Conjuntos de estudio relacionados

Verbs: Level 2: Distinguishing Action and Linking Verbs

View Set

Chapter 43: loss, grief, and dying

View Set

VHL central Practice OBJECTIVESActivity Return to Dashboard Lección 7 Pronunciación Other assigned activities for this due date Skip Workset Navigation Learn Pronunciation tutorial: The consonant r Practice Current ActivityDictado DictadoFill in the bla

View Set

Psych Chapter 3 Sensation and Perception

View Set

10 Brain Squeezer Geography Questions

View Set