100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

CPEN 333 MIDTERM REVIEW SET QUESTIONS AND DETAILED ANSWERS|ALREADY GRADED A

Puntuación
-
Vendido
-
Páginas
34
Grado
A+
Subido en
03-12-2025
Escrito en
2025/2026

CPEN 333 MIDTERM REVIEW SET QUESTIONS AND DETAILED ANSWERS|ALREADY GRADED A

Institución
CPEN
Grado
CPEN

Vista previa del contenido

CPEN 333 MIDTERM REVIEW SET QUESTIONS AND
DETAILED ANSWERS|ALREADY GRADED A
Which one of these print statements is NOT correct?


A: print("Hello world")
B: print "Hello World" Correct Ans- B


Which one of these print statements is NOT correct?
A: print("Hello world")
B: print('Hello world')
C: x = 2
print(x)
D: name = "CPEN333"
print(f"Course: {name}")
E: None of the above Correct Ans- E


Is the following code segment valid? (note that valid and good-style are
two different things)
print("Python is fantastic"); print("Python is fun")
A: Yes
B: No Correct Ans- A


An identifier can contain digits, but cannot start with a digit. True or
False?

,Example:
2Be = "To Be" Correct Ans- True


What will be displayed by the following code?
x=1
x = x + 2.5
print(x) Correct Ans- 3.5


The word True is? Correct Ans- both a keyword and a Boolean literal


Analyze the following code.
even = False
if even:
print("It is even!") Correct Ans- Prints nothing


How many times will the following code print "Welcome to Python"?
count = 0
while count < 10:
print("Welcome to Python")
count += 1 Correct Ans- 10


Which of the following function returns a sequence 0, 1, 2, 3?
A: range(0,3);

,B: range(0,4); Correct Ans- B


_______ is a template, blueprint, or contract that defines objects of the
same type. Correct Ans- A Class


The keyword __________ is required to define a class. Correct Ans-
class


An object is an instance of a __________. Correct Ans- class


Analyze the following code:
class A:
def __init__(self, s):
self.s = s
def print(self):
print(s)


a = A("Welcome")
a.print() Correct Ans- The program would run if you change print(s) to
print(self.s).


What is printed by the following code?
class Count:
def __init__(self):

, self.count = 0


def increment(c, times):
c.count += 1
times += 1


def main():
myCount = Count()
times = 0


for i in range(0, 100):
increment(myCount, times)


print("count is", myCount.count, "and times is", times)


if __name__=="__main__":
main() Correct Ans- count is 100 and times is 0


What is printed by the following code?
class Foo:
def __init__(self):
self.x = 1
self.__y = 1

Escuela, estudio y materia

Institución
CPEN
Grado
CPEN

Información del documento

Subido en
3 de diciembre de 2025
Número de páginas
34
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$13.99
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
Edumint
3.0
(2)

Conoce al vendedor

Seller avatar
Edumint Nightingale College
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
4
Miembro desde
6 meses
Número de seguidores
0
Documentos
1261
Última venta
1 mes hace
Exam Edge Papers – Sharpen your grade

Study smarter with well-structured notes and academic exam papers made to boost your performance.

3.0

2 reseñas

5
1
4
0
3
0
2
0
1
1

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes