Expression Statements and Print Operations MCQ Questions and Answers: Python Online Test

131

In Python, you can use an expression as a statement, too—that is, on a line by itself. But because the result of the expression won’t be saved, it usually makes sense to do so only if the expression does something useful as a side effect. Expressions are commonly used as statements in two situations:

  • For calls to functions and methods.
  • For printing values at the interactive prompt.

In Python, print prints things—it’s simply a programmer-friendly interface to the standard output stream. Technically, printing converts one or more objects to their textual representations, adds some minor formatting, and sends the resulting text to either standard output or another file-like stream. In a bit more detail, print is strongly bound up with the notions of files and streams in Python:

  • File object methods.
  • Standard output stream.

Quiz Description: 

Name: Expression Statements and Print Operations MCQ Questions and Answers: Python Online Test

Subject:  Python

Topic:  Expression Statements and Print Operations

Questions: 15 Objective Type Questions

Time Allowed: 15 Minutes

Language: English

Important for:  B. Tech. / M. Tech. Students, B.Sc. / M.Sc. (CS / IT) and aspirants of competitive exams, computer science job interviews, Python job interviews, etc.

Created By: Esha Tripathi

Previous QuizSearching: Data Structures and Algorithms MCQ Test
Next QuizNCERT Class 10 Maths Chapter 7 MCQ Test – Coordinate Geometry

LEAVE A REPLY

Please enter your comment!
Please enter your name here