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

Python 1 Final Exam Questions and Answers

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

Python 1 Final Exam Questions and Answers The definition of a variable is ____. - Correct Answer️️ -a storage location in a computer program What is the value of the variable named num after the following code snippet? num = 5 num2 = 6 num = num2 + 3 - Correct Answer️️ -9 What is the right way to assign the value of num + 10 to the variable num2? - Correct Answer️️ -num2 = num + 10 What is wrong here? 2ndNum = 78 - Correct Answer️️ -The 2ndNum variable is not a valid variable name Which line of code creates a variable named x and initializes it to the integer 5? - Correct Answer️️ -x = 5 Which of the following statements correctly calculates the average of three numbers, num1, num2, and num3? - Correct Answer️️ -( num1 + num2 + num3 ) / 3 A(n) ______ is a collection of programming instructions that carry out a particular task. - Correct Answer️️ -function If x=5.64, what is returned by this function? round(x) - Correct Answer️️ -6PDF DOCUMENT What must be done first before you can use a function from the standard library? - Correct Answer️️ -the function must be imported What is wrong with the following code snippet? ((num1 + num2) * num3 / 2 * (1 - num4) - Correct Answer️️ -there is an extra parenthesis What is it called when you splice two strings together in Python? - Correct Answer️️ - concatenation Given the code snippet below, what code is needed to print the person's initials? firstName = "Pamela" middleName = "Rose" lastName = "Smith" - Correct Answer️️ -print(firstName[0], middleName[0], lastName[0]) Which statement finds the last letter of the string variable name? - Correct Answer️️ - last = name[len(name) - 1] What is the default data type of input from the keyboard? - Correct Answer️️ -string Given the following statement, what statement correctly saves the number of items in the variable named quantity as an integer? userInput = input("Please enter the quantity: ") - Correct Answer️️ -quantity = int(userInput) What is the output for the following code snippet? area = 25 print("The area is %05d" % area) - Correct Answer️️ -The area is 00025PDF DOCUMENT From a python point of view, what is wrong with this statement? 72 = trombones - Correct Answer️️ -the variable must be on the left of the equal sign If you divide 2 integers with the / operator you get ____. - Correct Answer️️ -a floating point number If you divide 2 integers with the // operator you get ____. - Correct An


Información del documento

Subido en
17 de junio de 2024
Número de páginas
34
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas
$13.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.
OliviaWest
2.7
(23)
Vendido
119
Seguidores
17
Artículos
8334
Última venta
4 meses 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

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