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

Python- Multiple Choice (MCQ) Real Exam Prep Questions And Correct Answers Success Guaranteed.

Puntuación
-
Vendido
-
Páginas
3
Grado
A+
Subido en
03-02-2025
Escrito en
2024/2025

Which of the following statements create a dictionary? (Multiple Correct Answers Possible) a) d = {} b) d = {"john":40, "peter":45} c) d = {40:"john", 45:"peter"} d) d = (40:"john", 45:"50") - correct answer b, c & d. Which one of these is floor division? a) / b) // c) % d) None of the mentioned - correct answer b) // What is the maximum possible length of an identifier? a) 31 characters b) 63 characters c) 79 characters d) None of the above - correct answer D Why are local variable names beginning with an underscore discouraged? a) they are used to indicate a private variables of a class b) they confuse the interpreter c) they are used to indicate global variables d) they slow down execution - correct answer a Which of the following is an invalid statement? a) abc = 1,000,000 b) a b c = c) a,b,c = 1000, 2000, 3000 d) a_b_c = 1,000,000 - correct answer b) What is the output of the following? try: if '1' != 1: raise "someError" else: print("someError has not occured") except "someError": print ("someError has occured") a) someError has occured b) someError has not occured c) invalid code d) none of the above - correct answer C A new exception class must inherit from a BaseException. There is no such inheritance here. Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1] ? a) Error b) None c) 25 d) 2 - correct answer c) 25 The index -1 corresponds to the last index in the list. To open a file c: for writing, we use a) outfile = open("c:", "r") b) outfile = open("c:", "w") c) outfile = open(file = "c:", "r") d) outfile = open(file = "c:", "o") - correct answer b) The location contains double slashes ( ) and w is used to indicate that file is being written to. What is the output of the following? f = None for i in range (5): with open("", "w") as f: if i > 2: break print d a) True b) False c) None d) Error - correct answer

Mostrar más Leer menos
Institución
MCQ
Grado
MCQ








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

Escuela, estudio y materia

Institución
MCQ
Grado
MCQ

Información del documento

Subido en
3 de febrero de 2025
Número de páginas
3
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

Python- Multiple Choice (MCQ)

Which of the following statements create a dictionary? (Multiple Correct Answers Possible)

a) d = {}

b) d = {"john":40, "peter":45}

c) d = {40:"john", 45:"peter"}

d) d = (40:"john", 45:"50") - correct answer b, c & d.



Which one of these is floor division?

a) /

b) //

c) %

d) None of the mentioned - correct answer b) //



What is the maximum possible length of an identifier?

a) 31 characters

b) 63 characters

c) 79 characters

d) None of the above - correct answer D



Why are local variable names beginning with an underscore discouraged?

a) they are used to indicate a private variables of a class

b) they confuse the interpreter

c) they are used to indicate global variables

d) they slow down execution - correct answer a



Which of the following is an invalid statement?

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.
RealGrades Nursing
Ver perfil
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
170
Miembro desde
2 año
Número de seguidores
52
Documentos
11665
Última venta
3 semanas hace

4.0

26 reseñas

5
12
4
5
3
7
2
1
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