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

1. Which function is used to read input from the console in Python?

  • scanf()
  • read()
  • input()
  • get()
Show Answer Report

2. What does the print() function return in Python?

  • The printed string
  • 0
  • None
  • True
Show Answer Report

3. How can you display multiple values in a single print statement?

  • Using + operator
  • Using commas
  • Using & operator
  • Using concat()
Show Answer Report

4. What is the default data type of input received from input() function?

  • Integer
  • Float
  • String
  • Boolean
Show Answer Report

5. Which parameter in print() function prevents newline at the end?

  • newline
  • sep
  • end
  • break
Show Answer Report

6. How to convert string input to integer in Python?

  • str_to_int()
  • integer()
  • int()
  • convert_int()
Show Answer Report

7. What is the output of: print("Hello", "World", sep="-")?

  • Hello World
  • Hello-World
  • Hello,World
  • Hello - World
Show Answer Report

8. Which function is used for formatted output in Python?

  • printf()
  • format()
  • formatted()
  • output()
Show Answer Report

9. What happens if you press Enter without typing anything in input()?

  • Returns None
  • Returns 0
  • Returns empty string
  • Raises an error
Show Answer Report

10. How to display a variable value with descriptive text?

  • Using concatenation with +
  • Using multiple print statements
  • Using f-strings
  • All of the above
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test