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

Python Written Exam Q Uestions And Answers.

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

PYTHON WRITTEN EXAM Q UESTIONS AND ANSWERS. The following code represents a ________________ if structure. if a = 1: if a == 1: - CORRECT ANSWER nested Which line of code sets the value of the variable take_home to 500? take_home == 1500 / (1 + 2) take_home = 250 * 6 / 1 + 2 take_home = 250 * (5 % 3) take_home = 250 * 5 - 3 - CORRECT ANSWER take_home = 250 * (5 % 3) Given the code message = "Your percentage score of " percentage = "95.6" letter_grade = "% is an A grade." What is the correct code to display the following result? Your percentage score of 95.6% is an A grade. - CORRECT ANSWER print(message + percentage + letter_grade) Given the following parallel lists, which piece of code will print out each student and their major? students = ["Jimmy", "Ravi", "Lauren"] majors = ["Accounting", "Finance", "ISA"] - CORRECT ANSWER for i,student in enumerate(students): print(student + ", Major: " + majors[i]) What will be displayed by the following code? age = 18 score = 550 income = 60000 if age = 20 or (score 600 and income 50000): print("approved") elif age 18 and age 20: print("approved with condition") else: print("not approved") - CORRECT ANSWER not approved The while keyword takes a condition just like which other keyword? - CORRECT ANSWER if Which of the following is a valid variable name in Python?: 1st place None of these answers 1st_place and - CORRECT ANSWER None of these answers What is printed by the following program? my_total = 0 do_not_stop = True while do_not_stop == True: my_total += 5 if my_total 10: do_not_stop = False print(my_total) - CORRECT ANSWER 15

Vista previa del contenido

PYTHON WRITTEN EXAM Q UESTIONS
AND ANSWERS.
The following code represents a ________________ if structure.



if a >= 1:

if a == 1: - CORRECT ANSWER nested



Which line of code sets the value of the variable take_home to 500?

take_home == 1500 / (1 + 2)

take_home = 250 * + 2

take_home = 250 * (5 % 3)

take_home = 250 * 5 - 3 - CORRECT ANSWER take_home = 250 * (5 % 3)



Given the code

message = "Your percentage score of "

percentage = "95.6"

letter_grade = "% is an A grade."



What is the correct code to display the following result?

Your percentage score of 95.6% is an A grade. - CORRECT ANSWER print(message + percentage +
letter_grade)



Given the following parallel lists, which piece of code will print out each student and their major?



students = ["Jimmy", "Ravi", "Lauren"]

majors = ["Accounting", "Finance", "ISA"] - CORRECT ANSWER for i,student in enumerate(students):

print(student + ", Major: " + majors[i])

, What will be displayed by the following code?

age = 18

score = 550

income = 60000

if age >= 20 or (score > 600 and income > 50000):

print("approved")

elif age > 18 and age < 20:

print("approved with condition")

else:

print("not approved") - CORRECT ANSWER not approved



The while keyword takes a condition just like which other keyword? - CORRECT ANSWER if



Which of the following is a valid variable name in Python?:



1st place

None of these answers

1st_place

and - CORRECT ANSWER None of these answers



What is printed by the following program?



my_total = 0

do_not_stop = True

while do_not_stop == True:

my_total += 5

if my_total > 10:

do_not_stop = False

print(my_total) - CORRECT ANSWER 15

Información del documento

Subido en
5 de abril de 2025
Número de páginas
12
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$12.99

¿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.
ROSEGRADES
3.4
(35)
Vendido
236
Seguidores
87
Artículos
12121
Última venta
4 semanas 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