Console Input/Output Questions and Answers
Python Programming - Console Input/Output Questions with Answers teach how to take user input and display output efficiently. These Python Input Output Questions are often asked in SSC, RRB, TCS, and Accenture exams for programming fundamentals
Console Input/Output
Showing 10 of
25 questions
11. What is the purpose of the prompt message in input()?
- To store the input value
- To guide the user about expected input
- To validate the input
- To format the output
13. How to read multiple inputs in a single line?
- Using multiple input() calls
- Using input().split()
- Using readline()
- Using getinput()
14. What does the flush parameter in print() do?
- Clears the screen
- Forces immediate output
- Removes spaces
- Formats numbers
15. Which method is used to convert input to floating-point number?
- int()
- float()
- decimal()
- number()
16. How to display special characters like quotes in strings?
- Using escape sequences
- Using different quote types
- Using triple quotes
- All of the above
17. What is the output of: print(10, 20, 30, sep="::")?
- 10 20 30
- 10::20::30
- 10,20,30
- 102030
18. How to handle EOFError in input()?
- Using if-else
- Using try-except
- Using while loop
- Using break statement
19. Which function was used for console input in Python 2?
- scanf()
- raw_input()
- get_input()
- console_input()
20. What is the output of: print("A", "B", "C", end="!")?
- A B C
- A B C!
- A!B!C!
- ABC!