Python Examination Questions and Answers
Python Examination Questions and Answers The sys module is used to perform which function? - Correct Answer️️ -Gives the user access to display and process system information Which argument is used in an open command when one wants to open a file but not make changes to the file? - Correct Answer️️ -r (read) Select the correct code entry from the drop-down in the code sample that will complete the datetime function. - Correct Answer️️ -import datetime Which code entry, when used with the random module, can be used to generate a random number between one and ten? - Correct Answer️️ -randint Which os command should go in the blue box in the code sample to complete the function? - Correct Answer️️ -mkdir Which math function returns the integer of a square root of any number? - Correct Answer️️ -isqrt If a programmer wants to display a(n) _______ message that an exception caused, they should use the raise keyword. - Correct Answer️️ -error Runtime errors occur only when an app runs, and they usually _______ the app. - Correct Answer️️ -crash A programmer would like to display a message to users regardless of whether the try block was successful or not. In this case, why should a finally keyword be used instead of an else keyword after the try/except block? - Correct Answer️️ -An else statement will not run if the try block fails
Escuela, estudio y materia
- Institución
- Python Programming
- Grado
- Python Programming
Información del documento
- Subido en
- 17 de junio de 2024
- Número de páginas
- 4
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
python examination questions and answers
Documento también disponible en un lote