• ¿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 4 fuera de 167 páginas
Examen

Python Syntax Updated Exam Questions And Correct Answers

Document preview thumbnail
Vista previa 4 fuera de 167 páginas

Python Syntax Updated Exam Questions And Correct Answers

Vista previa del contenido

PYTHON SYNTAX UPDATED EXAM QUESTIONS AND
CORRECT ANSWERS
Question 1
What is the value of total_cost that gets printed

Total_cost = 5
Total_cost += 10
Print (total cost)
Correct Answer
15



Question 2
What is the output of the following code
Cool_number = 12 + 30
Cool_number *5
Print (cool_number)
Correct Answer
42



Question 3
What happens when running the following code
Message = what a cool message !
Print (message)
Correct Answer
Python throws a syntax error because the string is not surrounded by quotes



Question 4
What number is saved to exponented_variable in the following expression
2 ** 4
Correct Answer
16



Question 5
This produces a SyntaxError

Correct Answer
Answer= "is this an error'




Page 1 of 167

,Question 6
How does one define a multi-line string in python
Correct Answer
"""
Like this
"""



Question 7
What character begins a comment in python

Correct Answer
#



Question 8
What is python syntax for creating a variable and setting it equal to the number 10
Correct Answer
Variable_name = 10



Question 9
What function outputs text to the terminal
Correct Answer
Print ()



Question 10
How do you combine two strings
Correct Answer
String1 + string2



Question 11
What is the difference between float and an int

Correct Answer
A float represents decimal quantities. An int represents whole numbers



Question 12
What is the value of modulo_variable in the following expression
Modulo_variable = 14%4
Correct Answer
2




Page 2 of 167

,Question 13
This defined variable is a string
Correct Answer
Cool_variable_3 = "important message!"



Question 1
In Python the way to get the computer to speak is by using the _____ statement
Correct Answer
print ststement



Question 2
There are two different Python versions Python 2 and Python. The most significant difference between the two is
how you write a PRINT statement. In Python 3, print has ?
Correct Answer
() parentheses example : print("Hello World!")



Question 3
A string in Python is
Correct Answer
a series of letters, numbers, or symbols connected in order



Question 4
A string can be defined in two ways but it needs to be closed by the same type of quote mark
Correct Answer
(''),(') double quotes and single quotes



Question 5
We can combine multiple strings by using the

Correct Answer
+ plus like so : print "This is " + "a good string"



Question 6
Try adding your name to the print statement with the + operator so that this Python program prints "Hello
[your_name]"
Correct Answer
print "Hello " + "Rico "




Page 3 of 167

, Question 7
Mismatched quotes will cause what error
example: print "Mismatched quotes will cause a'
Correct Answer
SyntaxError: EOL while scanning a string literal. This mean that the string wasn't closed with the same quote-
character that staryed it



Question 8
Without quotes will cause a

Correct Answer
NameError This means that Python found what it thinks is a command, but doesn't know what it means because
it's not defined anywhere



Question 9
Python uses what to define things that are subject to change.
Correct Answer
Variables



Question 10
Create a variable called 'todays_date" and assign a value that will represent today's date to that variable.
Correct Answer
todays_date = "12/14/2021"



Question 11
Example of Python Arithmetic
Correct Answer
mirthful_addition = 12381 + 91817
amazing_subtraction = 981 -312
trippy_multiplication = 38 * 902
happy_division =
sassy_combinations = 129 * 1345 + -12



Question 12
Python also offers a companion to division called the modulo operator. The modulo operator is indicated by _____
and returns the remainder after division is performed.
Correct Answer
% percentage sign



Question 13
Multiply two numbers together and assign the results to a variable called product
Correct Answer
product = 2 * 2




Page 4 of 167

Información del documento

Subido en
29 de octubre de 2026
Número de páginas
167
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$17.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.
TutorExpert
3.7
(82)
Vendido
638
Seguidores
317
Artículos
11747
Última venta
2 días 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