Input and Output Operations in Python

Descripción

Coding Python Test sobre Input and Output Operations in Python, creado por PathaPadha Support el 27/10/2020.
PathaPadha Support
Test por PathaPadha Support, actualizado hace más de 1 año
PathaPadha Support
Creado por PathaPadha Support hace alrededor de 4 años
928
0

Resumen del Recurso

Pregunta 1

Pregunta
What is the output of the following print() function print(sep='--', 'Ben', 25, 'California')
Respuesta
  • Syntax Error
  • Ben–25–California
  • Ben 25 California

Pregunta 2

Pregunta
What is the output of the following print() function ? print('%d %d %.2f' % (11, '22', 11.22))
Respuesta
  • 11 22 11.22
  • TypeError
  • 11 ’22’ 11.22

Pregunta 3

Pregunta
Use the following file to predict the output of the code. test.txt Content: aaa bbb ccc ddd eee fff ggg Code: f = open("test.txt", "r") print(f.readline(3)) f.close()
Respuesta
  • bbb
  • Syntax Error
  • aaa
  • aa

Pregunta 4

Pregunta
What will be displayed as an output on the screen x = float('NaN') print('%f, %e, %F, %E' % (x, x, x, x))
Respuesta
  • nan, nan, NAN, NAN
  • nan, NaN, nan, NaN
  • NaN, NaN, NaN, NaN,

Pregunta 5

Pregunta
What is the output of print('[%c]' % 65)
Respuesta
  • 65
  • A
  • [A]
  • Syntax Error

Pregunta 6

Pregunta
In Python3, Whatever you enter as input, the input() function converts it into a string
Respuesta
  • True
  • False

Pregunta 7

Pregunta
What is the output of print('%x, %X' % (15, 15))
Respuesta
  • 15 15
  • F F
  • f f
  • f F

Pregunta 8

Pregunta
Which of the following is incorrect file handling mode in Python
Respuesta
  • wb+
  • ab
  • xr
  • ab+

Pregunta 9

Pregunta
Which of the following is incorrect file handling mode in Python
Respuesta
  • r
  • x
  • t+
  • b

Pregunta 10

Pregunta
What is the output of the following code print('PYnative ', end='//') print(' is for ', end='//') print(' Python Lovers', end='//')
Respuesta
  • PYnative / is for / Python Lovers /
  • PYnative // is for // Python Lovers //
  • PYnative // is for // Python Lovers//
  • PYnative / is for / Python Lovers/

Pregunta 11

Pregunta
What is true for file mode x
Respuesta
  • create a file if the specified file does not exist
  • Create a file, returns an error if the file exists
  • Create a file if it doesn’t exists else Truncate the existed file

Pregunta 12

Pregunta
In Python3, which functions are used to accept input from the user
Respuesta
  • input()
  • raw_input()
  • rawinput()
  • string()
Mostrar resumen completo Ocultar resumen completo

Similar

Python Quiz
karljmurphy
Think Python
tsilvo2001
Basic Python - Print Formatting
Rebecca Noel
What is Python?
Daniel Ingram
Python
54671
Know your Python!
educ8ict
Basic Python - Strings
Rebecca Noel
Study on IoT systems design
Tomasz Cieplak
Python
Kirstie Wu
OpenSource Programming
Faheem Ahmed
Basic Python - Lists
Rebecca Noel