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

CSCI 1301 MIDTERM PRACTICE (PYTHON) QUESTIONS WITH 100% CORRECT ANSWERS

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

CSCI 1301 MIDTERM PRACTICE (PYTHON) QUESTIONS WITH 100% CORRECT ANSWERS

Institución
CSCI 1301
Grado
CSCI 1301











Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CSCI 1301
Grado
CSCI 1301

Información del documento

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

Temas

Vista previa del contenido

What will be the output of the following Python code?


my_dict={1:"A", 2:"B", 3:"C"}
for i, j in my_dict.items():
print( i, j, end=" " )


Give this one a try later!

, 1A2 B3C




What will be the output of the following Python code?


def foo():
try:
print( x + 4)
finally:
print('print finally block')
print('print after finally block')
foo( )


Give this one a try later!


NameError: name 'x' is not defined




What will be the value of 'result' in following Python program?


list1 = [1,2,3,4]
list2 = [2,4,5,6]
list3 = [2,6,7,8]
result = list()


result.extend( i for i in list1 if i not in (list2+list3) and i not in result )
result.extend( i for i in list2 if i not in (list1+list3) and i not in result )
result.extend( i for i in list3 if i not in (list1+list2) and i not in result )


print(result)


Give this one a try later!

, [1, 3, 5, 7, 8]




Which code can output "we will go to mountain" ?


Give this one a try later!


class Foo:
a = "mountain"
def __init__(self, a):
self.a = a
def someday(self):
return "we will go to " + Foo.a


f1 = Foo("Hi, Jack")
print(f1.someday())




Which of these about a dictionary is false?


Give this one a try later!


The keys of a dictionary can be accessed using values




What output of result in following Python program?
list1 = [1,2,3,4]
list2 = [2,4,5,6]
result1 = list1 + list2
result2 = list1 * 2
print( result1 )
print( result2 )

, Give this one a try later!


12342456
12341234




What is the list comprehension equivalent for?


{x : x is a whole number less than 20, x is even} (including zero)


Give this one a try later!


[x for x in range(0, 20) if (x%2 ==0)]




What will be the output of the following Python code?


Give this one a try later!


ABCD




To read file's contents as a list of lines from a file object myfile, we use____


Give this one a try later!


myfile.readlines()




Which of the following is a legal Python identifier?
$10.50
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


Documento también disponible en un lote

Conoce al vendedor

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.
TestITandFixIT Johns Hopkins University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
36
Miembro desde
1 año
Número de seguidores
0
Documentos
4737
Última venta
4 días hace

3.5

8 reseñas

5
3
4
2
3
1
2
0
1
2

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