CS 1101 Questions and Answers Already Graded A
CS 1101 Questions and Answers Already Graded A In the following segment of Python code, what do we call the portion of the statement that follows the dot('.capitalize')? alize('maryland') a. Module b. Method c. Attribute d. Function name b. Method Assume that d is a Python dictionary. What does the following Python code produce? for k in d: if d[k] == v: return k Select one: a. a histogram b. an inverted dictionary c. a list of tuples d. a lookup e. a reverse lookup e. a reverse lookup Python tuples are immutable. True False True Python functions can take a variable number of arguments. True False True Traversal can only be accomplished with the "while" loop. True False False Assume that d is a Python dictionary. What does the following Python code produce? result = dict() for key in d: val = d[key] if val not in result: result[val] = [key] else: result[val].append(key) a. a histogram b. an inverted dictionary c. a list of tuples d. a lookup e. a reverse lookup b. an inverted dictionary Which of the following types are allowed for Python dictionary keys? Select one: a. dictionary b. list c. list of dictionaries d. tuple e. All of the above d. tuple What is the value of the following Python expression? (0, 1, 5, 2) > (0, 1.0, 4, 3.1) a. 0 b. 1 c. False d. True e. syntax error d. True What will the contents of mylist
École, étude et sujet
- Établissement
- CS 1101
- Cours
- CS 1101
Infos sur le Document
- Publié le
- 18 mai 2024
- Nombre de pages
- 6
- Écrit en
- 2023/2024
- Type
- Examen
- Contient
- Questions et réponses
Sujets
-
cs 1101 questions and answers already graded a
Document également disponible en groupe