• ¿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 9 páginas
Examen

CS 170 || with A+ Guaranteed Solutions.

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

What is the result of evaluating 7%2 ? correct answers 1 What is the output from the following program, assuming that the user enters the input value 5. def main(): n = eval(input("Enter a number: ")) ans=0 for x in range(1,n): ans = ans + x print(ans) correct answers none of the above 5: 10 Identifiers in Python may not contain correct answers spaces Suppose a program executes the following statement. value = eval(input("Enter a number: ")) In response to the prompt, the user types 5 + 5. What is the result? correct answers value contains 10 The fragment of code eval(input("Enter a number: ")) is best described as: correct answers an expression that returns the result of evaluating what the user types What Python statement allows the math library to be used in a program? correct answers import math What is the result of evaluating list(range(1,7,2)) ? correct answers none of the above [1,3,5] What is the result of evaluating 3 + 4.0 correct answers 7.0 Fragments of code that produce new data values are called correct answers expressions The goal of the specification phase of the software development process is correct answers to determine what the program should do Suppose that the variable x has the value 5 and y has the value 10. After executing this statement: x,y = y,x what will the values of x and y be, respectively? correct answers 10 and 5 When a Python int gets "too large" it correct answers requires more memory to store What is the output from the following code fragment: fact=1 for factor in range(5): fact = fact * factor

Vista previa del contenido

CS 170 || with A+ Guaranteed Solutions.
What is the result of evaluating 7%2 ? correct answers 1

What is the output from the following program, assuming that the user enters the input value 5.
def main():
n = eval(input("Enter a number: "))
ans=0 for x in range(1,n):
ans = ans + x
print(ans) correct answers none of the above
5: 10

Identifiers in Python may not contain correct answers spaces

Suppose a program executes the following statement.
value = eval(input("Enter a number: "))
In response to the prompt, the user types 5 + 5. What is the result? correct answers value contains
10

The fragment of code eval(input("Enter a number: ")) is best described as: correct answers an
expression that returns the result of evaluating what the user types

What Python statement allows the math library to be used in a program? correct answers import
math

What is the result of evaluating list(range(1,7,2)) ? correct answers none of the above
[1,3,5]

What is the result of evaluating 3 + 4.0 correct answers 7.0

Fragments of code that produce new data values are called correct answers expressions

The goal of the specification phase of the software development process is correct answers to
determine what the program should do

Suppose that the variable x has the value 5 and y has the value 10. After executing this
statement:
x,y = y,x
what will the values of x and y be, respectively? correct answers 10 and 5

When a Python int gets "too large" it correct answers requires more memory to store

What is the output from the following code fragment:
fact=1
for factor in range(5):
fact = fact * factor

, print(fact) correct answers 0

Which of the following is a correct Python expression for converting temperatures from Celsius
to Fahrenheit? correct answers fahrenheit = (9/5) * celsius + 32

Suppose that the variable x has the value 5 and y has the value 10. After executing these
statements: correct answers 10 and 10

Which of the following is a counted loop that executes 5 times? correct answers for i in range(5):

Which of the following is not an example of a function from the Python math library? correct
answers abs(x)

What is the result of evaluating 7//2 ? correct answers 3

The goal of the design phase of the software development process is correct answers to create an
algorithm that solves the problem

Suppose that the variable x currently has the value 20. What statement would cause the value of
x to become 25? correct answers x = x+5

The program pattern IPO stands for correct answers input process output

Consider the following program:def main():
num = eval(input("Enter a number: "))
for i in range(5):
num = num // 2
print(num)
main() if you entered in 1024 correct answers 32

What is the output from the following program fragment?
for i in [1,3,5,7]:
print(2 * i, end=" ") correct answers 2 6 10 14

What is the result of evaluating the expression list(range(5)) ? correct answers [0, 1, 2, 3, 4]

The Python reserved word for performing output to the screen is correct answers print

Magnetic or optical media are generally used for: correct answers secondary memory

The Python numeric type that can represent positive and negative whole numbers is correct
answers int

Python identifiers must start with a letter or underscore. correct answers

Información del documento

Subido en
25 de marzo de 2025
Número de páginas
9
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$11.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.
SirAnton
3.7
(118)
Vendido
811
Seguidores
438
Artículos
40316
Última venta
1 semana 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