• ¿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 2 fuera de 15 páginas
Examen

Inf1511-Mcq-Pack.

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

1. Which of the following are true for objects of Python’s set type: The order of elements in a set is significant. A given element can’t appear in a set more than once. A set may contain elements that are mutable. Sets are mutable. 2. Which of the following define the set {'a', 'b', 'c'}: s = {('a', 'b', 'c')} s = set('a', 'b', 'c') s = {'a', 'b', 'c'} s = set('abc') s = set(['a', 'b', 'c']) 3. What Python expression tests whether the string 'foo' is a member of set s? 'foo' in s 4. You have a set s defined as follows: s = {100, 200, 300} Which one of the following statements does not correctly produce the union of s and the set {300, 400, 500}: s | [300, 400, 500] s | {300, 400, 500} ({300, 400, 500}) s | set([300, 400, 500]) ([300, 400, 500]) (set([300, 400, 500])) INF1511-MCQ-PACK. 5. What is the result of this statement: {'b', 'a', 'r'} & set('qux') {'b', 'r', 'a'} {'q', 'r', 'x', 'u', 'b', 'a'} {} set() 6. What is the result of this statement: {1, 2, 3, 4, 5} - {3, 4} ^ {5, 6, 7} {1, 2, 6, 7} set() {1, 2} {3, 4, 5, 6, 7} 7. Consider the following expression involving two sets x and y: (x & y = x) and (x & y = y) This expression is True for any sets x and y—true or false? False True 8. What is the result of the highlighted expression: x = {1, 2, 3} y = {1, 2} persubset(x) It raises an exception. set() True False 9. Suppose a set s is defined as follows: s = {'foo', 'bar', 'baz', 'qux'} Which of the following remove element 'bar' from s: s -= {'bar'} s &= {'foo', 'baz', 'qux'} rd('bar') () del s['bar'] rence_update({'bar'}) 10. Which of the following are true about frozen sets: A frozen set can be a member of a set, and can serve as a dictionary key. If f is a frozen set, the statement f |= {'foo'} will raise an exception. You can define a frozen set with this syntax: f = f{'a', 'b', 'c'} If f is a frozen set, the statement ('foo') will raise an exception. 11. s = 'foo' t = 'bar' print('barf' in 2 * (s + t)) What is the output of the print() function call? True False


Información del documento

Subido en
25 de noviembre de 2021
Número de páginas
15
Escrito en
2021/2022
Tipo
Examen
Contiene
Preguntas y respuestas
$3.79

¿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.
LOVELY01
3.6
(127)
Vendido
1015
Seguidores
881
Artículos
2321
Última venta
4 meses 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

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