Console Input/Output Questions and Answers

Take Exam

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
Show Answer Report

12. Which escape sequence adds a tab space in print()?

  • \n
  • \t
  • \s
  • \tab
Show Answer Report

13. How to read multiple inputs in a single line?

  • Using multiple input() calls
  • Using input().split()
  • Using readline()
  • Using getinput()
Show Answer Report

14. What does the flush parameter in print() do?

  • Clears the screen
  • Forces immediate output
  • Removes spaces
  • Formats numbers
Show Answer Report

15. Which method is used to convert input to floating-point number?

  • int()
  • float()
  • decimal()
  • number()
Show Answer Report

16. How to display special characters like quotes in strings?

  • Using escape sequences
  • Using different quote types
  • Using triple quotes
  • All of the above
Show Answer Report

17. What is the output of: print(10, 20, 30, sep="::")?

  • 10 20 30
  • 10::20::30
  • 10,20,30
  • 102030
Show Answer Report

18. How to handle EOFError in input()?

  • Using if-else
  • Using try-except
  • Using while loop
  • Using break statement
Show Answer Report

19. Which function was used for console input in Python 2?

  • scanf()
  • raw_input()
  • get_input()
  • console_input()
Show Answer Report

20. What is the output of: print("A", "B", "C", end="!")?

  • A B C
  • A B C!
  • A!B!C!
  • ABC!
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test