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 6 páginas
Examen

CNIT 155 MIDTERM QUESTIONS & ANSWERS

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

CNIT 155 MIDTERM QUESTIONS & ANSWERS

Vista previa del contenido

CNIT 155 MIDTERM QUESTIONS & ANSWERS


The int function can be used to convert a string of digits into an integer. - Answers -
True

Any inputted data is considered string data, regardless of what the user inputted. -
Answers -True

Computers can create true random numbers - Answers -False

Boolean only has two possible values. - Answers -True

The if-else structure will always execute only one of the two actions. - Answers -True

What is the extension of the source file for a python program - Answers -.py

A logical operator determines whether a specific relationship exists between two values
- Answers -False

Which of the following correctly define string variable in python?

ProgrammerDialogue = 'Coding in python is fun!'
CNIT = *I am a CIT student.*
PurdueString = I attend Purdue University.
All of the above - Answers -ProgrammerDialogue = 'Coding in python is fun!'

IF is a legal python identifier - Answers -False

String can be used as a sequence in a for loop - Answers -True

Python needs a main function to operate - Answers -False

While loops are pretest loops - Answers -True

Syntax Errors occur when a program provides you with actual outputs that are different
from the desired outputs (The program runs but it gives the wrong results). - Answers -
False

sum_total is a legal python identifier - Answers -True

IN is a reserved word in Python - Answers -True

It is better to use elif over else to cover all the remaining cases in a chained if/elif. -
Answers -False

, The input function returns a Boolean if the user types in True - Answers -False

The expression (2 + * 3) results in an integer value - Answers -False

The ^ operator is the same as the ** operator in Python - Answers -False

In Python, the division operator (/) gives a float result, even if both of the numbers are
integers - Answers -True

If you enter a bunch of letters in response to the input function, the input function returns
a string. - Answers -True

What is the output of the following code?

n = 20
while (n <= 25):
print (n,"\n")
n = n + 1 - Answers -20, 21, 22, 23, 24, 25

The expression 3 ** 3 - ( 6 - 2 ) / 2 has the value _____. Is it an integer or a float value?
__________________.

7, int
25, float
7, float
25, int - Answers -25, float

What is max(3, 5, 1, 7, 4)? - Answers -7

What is printed by the last line of the following code:

x = 10
y = input("enter a letter: ")
print(y)

Assume the user enters the letter z in response to the prompt - Answers -z

What is printed by the last line of the following code:

x = 10
y = input("enter a letter: ")
print(y)

Assume the user enters the letter x in response to the prompt - Answers -nothing, an
error occurs

Información del documento

Subido en
24 de enero de 2026
Número de páginas
6
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$13.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.
GEEKA
3.8
(360)
Vendido
2132
Seguidores
1446
Artículos
57748
Última venta
1 hora 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