CS 1101 Questions and Answers with Verified Solutions
CS 1101 Questions and Answers with Verified Solutions Expressions evaluate to either true or false. What will the output of the following code be when the expression "Ni!" is evaluated? if "Ni!": print ('We are the Knights who say, "Ni!"') else: print ("Stop it! No more of this!") Select one: a. Stop it! b. We are the Knights who say, "Ni!" Correct c. Stop it! No more of this!" d. No output will be produced We are the Knights who say, "Ni!" How many different values can a Boolean expression have? Select one: a. 3 b. 2 Correct c. infinite number d. 1 e. not defined 2 True/False: The % or modulus operator returns the remainder present when two integers do not divide evenly into one another Select one: True Correct False True One way to generalize a function is to replace a variable with a value. Select one: True Incorrect False False The order in which statements are executed during a program run. → flow of execution, The first part of a compound statement, begins with a keyword and ends with a colon ( : ) → header, A statement that executes a function. It consists of the name of the function followed by a list of arguments enclosed in parentheses. → function call, A variable defined inside a function that can only be used inside its function. → local variable, A graphical representation of functions, their variables, and the values to which they refer. → stack diagram The order in which statements are executed during a program run. → flow of execution, The first part of a compound statement, begins with a keyword and ends with a colon ( : ) → header, A statement that executes a function. It consists of the name of the function followed by a list of arguments enclosed in parentheses. → function call, A variable defined inside a function that can only be used inside its function. → local variable, A graphical representation of functions, their variables, and the values to which they refer. → stack diagram What is the output of the following statements? pi = float(3.14159) print (pi) Select one: a. 3 b. 3.0 c. 3.14159 Correct d. 0 3.14159 What is the output of the following Python statements? percentage = ( 60 * 100) // 55 print (percentage) Select one: a. percentage b. 109 Correct c. 109. d. 109.0 109 What is the output of the following Python statements? def recurse(a): if (a == 0): print(a)
Escuela, estudio y materia
- Institución
- CS 1101
- Grado
- CS 1101
Información del documento
- Subido en
- 18 de mayo de 2024
- Número de páginas
- 93
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
cs 1101 questions and answers with verified solut
Documento también disponible en un lote