• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 1 fuera de 2 páginas
Examen

Python Essentials | Part 1 Summary Test-Questions and Answers

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

Python Essentials | Part 1 Summary Test-Questions and Answers 1. Which of the following lines incorrectly. invokes the function defines as: def fun (a, b, c=0) : - ANSWER-fun ( 2. What is the output of the following snippet? list = [x * x for x in range (5) ] def fun (1st) : del 1st [1st [2] ] return 1st print (fun (list) ) - ANSWER-[ ] 3. How many elements does the 1st list contain? 1st = [i for i in range (-1, -2) ] - ANSWER-One, Two, Three, Zero 4. What is the output of the following snippet? dct = {} dct [ '1' ] = (1, 2) dct [ '2' ] = (2, 1) for x in () : print (dct [x] [1] ,enf="") - ANSWER-12 or (1,2) or 21 or (2,1) 5. Assuming that the "tuple" is a correctly created tuple, the fact that tuples are immutable means that the following instruction: tuple [1] = tuple [0] - ANSWER- 6. The following snippet: def func(a, b) : return b ** a print (func (b=2, 2) ) - ANSWER- 7. What is the output of the following piece of code? print ("a", "b", "c", sep="sep") - ANSWER- 8. An operator able to check whether two values are not equal is coded as: - ANSWER- 9. What is the output of the following snippet? dct = { 'one' : 'two', 'three' : 'one, 'two' : 'three' } v =v dct ['three'] for k in range (len(dct) ) : v = dct [v]

Vista previa del contenido

Python Essentials | Part 1 Summary Test-Questions and Answers 1. Which of the following lines incorrectly. invokes the function defines as:
def fun (a, b, c=0) : - ANSWER-fun (
2. What is the output of the following snippet?
list = [x * x for x in range (5) ]
def fun (1st) : del 1st [1st [2] ] return 1st
print (fun (list) ) - ANSWER-[ ]
3. How many elements does the 1st list contain?
1st = [i for i in range (-1, -2) ] - ANSWER-One, Two, Three, Zero
4. What is the output of the following snippet?
dct = {}
dct [ '1' ] = (1, 2)
dct [ '2' ] = (2, 1)
for x in dct.keys () : print (dct [x] [1] ,enf="") - ANSWER-12 or (1,2) or 21 or (2,1)
5. Assuming that the "tuple" is a correctly created tuple, the fact that tuples are immutable means that the following instruction:
tuple [1] = tuple [0] - ANSWER-
6. The following snippet:
def func(a, b) : return b ** a print (func (b=2, 2) ) - ANSWER-
7. What is the output of the following piece of code?
print ("a", "b", "c", sep="sep") - ANSWER-
8. An operator able to check whether two values are not equal is coded as: - ANSWER-
9. What is the output of the following snippet?
dct = { 'one' : 'two', 'three' : 'one, 'two' : 'three' }
v =v dct ['three'] for k in range (len(dct) ) : v = dct [v]

Información del documento

Subido en
28 de marzo de 2024
Número de páginas
2
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas
$8.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

Vendido
0
Seguidores
0
Artículos
386
Última venta
-




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