• ¿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 Final Exam (questions with complete solutions) 12

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

Python Final Exam (questions with complete solutions) 12

Vista previa del contenido

Python Final Exam (questions with
complete solutions) 12

If I wanted to take a number, say 5, and assign it to a Variable, let's say the letter y, how would I code
that? - correct answer ✔✔y = 5



How would I print out the variable y? - correct answer ✔✔print(y)



A best practice is to assign variable names that have some sort of meaning - correct answer ✔✔True



What would the following code print?



print('don't skip the coffee') - correct answer ✔✔SyntaxError: invalid syntax



Python understands order of operations but you need to be careful to use python operators.



For example,



(3+4)2 does not work.

(3+4)*2 does work.

What are some of the operators we covered? - correct answer ✔✔+ is addition

* is multiplication

/ is division

% is modulus



The following 4 questions all have a snippet of code, and a comment. The comment following the code in
the questions below makes a statement. Which of these statements is correct? - correct answer ✔✔The
following is a correct comment:

, 1 + 1 # evaluates to 2



The following is not a correct comment:



1 + 1 # evaluates to 3



True + 100 #evaluates to 101 - correct answer ✔✔Correct



1 + 1(7) # evaluates to 8 - correct answer ✔✔False



print_twice('Hello") #evaluates to 'Hello Hello" - correct answer ✔✔Incorrect



The below code is what you see when you open a notebook.



if x < 0:

print('x is negative')



What prints when that notebook cell is run? - correct answer ✔✔an error



The below code is what you see when you open a notebook.



'what subset?' [1:2]



What prints when that notebook cell is run? - correct answer ✔✔h



Complete the following if statement so that when you run it prints "x is even"



x = 10

Información del documento

Subido en
17 de octubre de 2024
Número de páginas
12
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$16.49

¿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.
StuviaExamHub
3.7
(91)
Vendido
495
Seguidores
356
Artículos
25816
Última venta
1 día 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