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

Python Exam 2 questions with correct answers graded A+ (12)

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

Python Exam 2 questions with correct answers graded A+ (12)

Vista previa del contenido

Python Exam 2 questions with correct
answers graded A+ (12)

If a file with the specified name already exists when the file is opened and the file is opened in 'w' mode,
then an alert will appear on the screen. - correct answer ✔✔False



When a piece of data is read from a file, it is copied from the file into the program - correct answer
✔✔false



closing a file disconnects the communication between the file and the program - correct answer ✔✔true



In python, there is nothing that can be donee if the program tries to access a file to read that does not
exist - correct answer ✔✔false



Python allows the programmer to work with text and number files - correct answer ✔✔false



The ZeroDivisionError exception is raised when the program attempts to perform the calculation x/y if y
= 0 - correct answer ✔✔true



An exception handler is a piece of code that is written using the try/except statement - correct answer
✔✔true



if the last line in a file is not terminated with \n, the deadline method will return the line without the \n -
correct answer ✔✔true



Strings can be written directly to a file with the WRITE method, but the numbers must be converted to
strings before they can be written. - correct answer ✔✔true



It is possible to create a WHILE loop that determines when the end of a file has been reached - correct
answer ✔✔true

, Which of the following is associated with a specific file and provides a way for the program to work with
that file - correct answer ✔✔the file object



What is the process of retrieving data from a file called - correct answer ✔✔reading data



which of the following describes what happens when a piece of data is written to a file - correct answer
✔✔the data is copied from a variable in RAM to a file



Which steep creates a connection between a file and a program - correct answer ✔✔open the file



How many types of files are there - correct answer ✔✔two



A(n) _______ access file is also known as a direct access file - correct answer ✔✔random



Which type of file access jumps directly to a piece of data in the file without having to read all the data
that comes before it - correct answer ✔✔random



A single piece of data within a record is called a - correct answer ✔✔field



Which mode specifier will erase the contents of a file it if already exists and create the file if it does not
already exist - correct answer ✔✔'w'



Which mode specifier will open a file but not let you change the file or write to it - correct answer ✔✔'r'



Which method could be used to strip specific characters from the end of a string - correct answer
✔✔rstrip



Which method could be used to convert a numeric value to a string - correct answer ✔✔str

Información del documento

Subido en
17 de octubre de 2024
Número de páginas
11
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$15.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
499
Seguidores
356
Artículos
26308
Ú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