100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

Python Exam Chapters 1-5 Questions with Answers merged

Puntuación
-
Vendido
-
Páginas
13
Grado
A+
Subido en
08-06-2024
Escrito en
2023/2024

Which of the following are operators, and which are values? * 'hello' -88.8 - / + 5 - The operators are +,-,*,and /. The values are 'hello' ,-88.8, and 5. Which of the following is a variable , and which is a string ? spam 'spam' - The variable is spam; the string is 'spam'. Strings always start and end with quotes. Name three data types. - The three data types are integers, floating point numbers, and strings. What is an expression made up of ? What do all expressions do ? - An expression is a combination of values and operators. All expressions evaluate (that is, reduce) to a single value. This chapter (1) introduced assignment statements, like spam = 10. What is the difference between an expression and a statement? - An expression evaluates to a single value. A statement does not. What does the variable bacon contain after the following code runs? bacon = 20 bacon + 1 - The bacon variable is set to 20. The bacon + 1 expression does not reassign the value in bacon (that would need an assignment statement: bacon = bacon + 1). What should the following two expressions evaluate to ? 'spam' + 'spamspam' 'spam' * 3 - Both expressions evaluate to the string 'spamspamspam'. Why is egg a valid variable name while 100 is invalid ? - Variable names cannot begin with a number. What three functions can be used to get the integer, floating-point number, or string version of a value ? - The int(), float(), and str() functions will evaluate to the integer, floating-point number, and string versions of the value passed to them. Why does this expression cause an error ? How can you fix it ? 'I have eaten' + 99 + 'burritos' . - The expression causes an error because 99 is an integer, and only strings can be concatenated to other strings with the + operator. The correct way is i have eaten ' + str(99) + ' burritos '. What are the two values of the Boolean data type? How do you write them? - True and False, using capital T and F, with the rest of the word in lowercase. What are the three Boolean operators? - and, or, and not. Write out the truth tables of each Boolean operator (that is, every possible combination of Boolean values for the operator and what they evaluate to). - True and True is True. True and False is False. False and True is False. False and False is False. True or True is True. True or False is True. False or True is True. False or False is False. not True is False. not False is True. What do the following expressions evaluate to ? (5 > 4) and (3 == 5) not (5 >4) (5 > 4) or (3 == 5) not ((5 > 4) or (3 == 5)) (True and True) and (True == False) (not False) or (not True) - False

Mostrar más Leer menos
Institución
Programming For Python Language..
Grado
Programming for python language..









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Programming for python language..
Grado
Programming for python language..

Información del documento

Subido en
8 de junio de 2024
Número de páginas
13
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

$11.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

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.
AnyaTaylor A.T. Still University
Ver perfil
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
98
Miembro desde
1 año
Número de seguidores
25
Documentos
1934
Última venta
1 semana hace
Williams Tech.Smartlearners

4.3

16 reseñas

5
11
4
2
3
1
2
0
1
2

Recientemente visto por ti

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