stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
OOP Flashcards | StudBud
Explore
/
OOP
An example of a logical language is:
Which Exception will it return?
OOP
29 terms
·
StudBud Administration
·
28 plays
Imported from external platform
Flashcards
29 cards
F
Practice quiz
P
Host live
L
Questions
29
Answers
1
Which Exception will it return?
ValueError
KeyError
None
NameError
2
An example of a logical language is:
C
PROLOG
Haskell
F#
3
The finally clause is executed
there is not finally clause
only if the exception did not occur
only if the exception occurred
regardless of whether the exception occurred or not
4
Which Exception will it return?
It will not return an Exception
NameError
VarError
ValueError
5
Object-oriented programming is an approach to modelling specific things in the real world.
True
False
6
OOP objects have:
only attributes
attributes and methods
only methods
7
Which Exception will it return?
NameError
ValueError
IndexError
KeyError
8
The decorator is used by inserting a line starting with ________ in front of the definition of the decorated object.
_
!
-
@
9
The basic concepts of object-oriented programming are:
morphism, encapsulation, polyabstraction, inheritance
abstraction, encapsulation, polymorphism, inheritance
10
Special character: plus:
+
matches zero or one occurrence of the preceding character
means one or more occurrences
11
abstraction
hiding access to private details of an object
the ability to use same interface for objects of different types
class extension
limiting the features of object from real world to the essential features
12
Python is a multi-paradigm language
False
True
13
Serialization
is about saving an existing object in ___________ memory
temporary
permanent
14
ab* matches:
string that has an a followed by one or more b's
string that has an a followed by zero or more b's
15
OOP wants to model the real world objects
False
True
16
polymorphism
the ability to use same interface for objects of different types
hiding access to private details of an object
class extension
17
Dot . matches:
any character except a newline character
negation of the characters given in square brackets
the end of a line
18
An example of a functional language is:
PROLOG
C++
C
Haskell
19
Inheritance
the ability to use same interface for objects of different types
the ability to use same interface for objects of different types
expanding the base class
20
Special character: asterisk: *
matches zero or one occurrence of the preceding character
does not exist
means one or more occurrences
stands for any number of occurrences of a character (including zero)
21
Which Exception will it return?
NameError
ValueError
All of the mentioned
KeyError
22
A decorator can have arguments
False
True
23
When will the try clause be executed?
if we get ZeroDivisionError
if an exception occurs
if we don't get ZeroDivisionError
if no exception occurs
24
An example of an imperative language is:
BASIC
Haskell
F#
Lisp
25
If we want to use a special character, but have it treated as ordinary:
we cannot
we must precede it with a hash
we must precede it with a backslash
we must precede it with a question mark
26
encapsulation
hiding access to private details of an object
the ability to use same interface for objects of different types
limiting the features of object from real world to the essential features
class extension
27
class Student(Person):
class Student is extending class Person
class Person is extending class Student
28
Special character: question mark:
?
matches zero or one occurrence of the preceding character
stands for any number of occurrences of a character (including zero)
means one or more occurrences
matches one or two occurrence of the preceding character
29
Which is true in Python
a function cannot take another function as an argument
a function may take another function as an argument
inside a function you cannot create another function
a function can only take a variable as an argument