Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 5 páginas
Examen

CNIT 155 MIDTERM 2026 EXAM QUESTIONS AND SOLUTIONS RATED

Document preview thumbnail
Vista previa 2 fuera de 5 páginas

CNIT 155 MIDTERM 2026 EXAM QUESTIONS AND SOLUTIONS RATED

Vista previa del contenido

CNIT 155 MIDTERM 2026 EXAM QUESTIONS AND
SOLUTIONS RATED A+
✔✔Which of the following statements about a programs main function is not true?

it must be called before it is defined
by convention, it is the first function to be called
all answers are not true
by convention, it is called after all functions are defined - ✔✔it must be called before it is
defined

✔✔What will be displayed when the following code is executed?

number = 6
while number > 0:
number -= 3
print(number, end = ' ')

630
30
0 -3
6 3 - ✔✔3 0

✔✔Which character starts a comment in a python program? - ✔✔#

✔✔What's the output?

count = 0
for n in range (6):
if n % 2 !=0:
count = count + 2
print(count) - ✔✔6

✔✔Which of the following is the correct syntax for a while loop?

while(condition)
Block of statements

while(condition):
Block of statements

while var in sequence:
statement

while(condition):

, Block of statements - ✔✔while(condition):
Block of statements

✔✔Analyze the following code.

count = 0
while count < 100:
# Point A
print("Welcome to Python!")
count += 1
# Point B
# Point C - ✔✔count < 100 is always True at Point A

✔✔Which of the following range function will result in a for loop counting backwards?

range(-1, 3)
range(3, 0, -1)
range(1, 3, -1)
range(3, -1) - ✔✔range(3, 0, -1)

✔✔The input function is used to ______ and returns a ________. - ✔✔prompt for text
input from user, string

✔✔Which of the following have the highest precedence?

=Assignment operator
Arithmetic operators
Logical operators
Relational operators - ✔✔Arithmetic operators

✔✔Which of the following range function syntax is incorrect?

range(1, 2.5, 4.5)
range(10, 4, -1)
range(0, 3)
range(1, 3, 1) - ✔✔range(1, 2.5, 4.5)

✔✔The input function takes a _________ as a parameter value and returns a(n)
______. - ✔✔string, string

✔✔How many times will the following code print "Welcome to Python"?

count = 0

Información del documento

Subido en
16 de abril de 2026
Número de páginas
5
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$14.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
BOARDWALK
3.5
(40)
Vendido
276
Seguidores
8
Artículos
32861
Última venta
6 días hace


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