What is a dictionary in Python?, A collection of ordered pairs of keys and values, A type of list, A collection of functions, A list of strings, How do you define a dictionary in Python?, d = {}, d = [], d = (), d = dict(), What function is used to add a key-value pair to a dictionary in Python?, A) append(), B) insert(), C) update(), D) add(), Which of the following is a correct way to access the value of a specific key in a Python dictionary?, A) dict[<key>], B) dict.get(<key>), C) dict.<key>(), D) Both A and B, Which method is used to get a list of all the values in a Python dictionary?, A) values(), B) keys(), C) items(), D) lists(), What method would you use to retrieve a value for a specific key from a Python dictionary?, A) get(), B) find(), C) extract(), D) fetch(), What will the following code output?, A) None, B) 0, C) "Not Found", D) KeyError, Which method would you use to remove a key-value pair from a dictionary in Python?, A) del, B) remove(), C) pop(), D) Both A and C, How can you check if a key exists in a Python dictionary?, A) key in dictionary, B) dictionary.has_key(key), C) key.exists(), D) dictionary.check_key(key), What does the keys() method return when called on a dictionary?, A) A list of values, B) A list of keys, C) A dictionary, D) A tuple of key-value pairs.

Tabla de clasificación

Estilo visual

Opciones

Cambiar plantilla

¿Restaurar actividad almacenada automáticamente: ?