Expression Statements and Print Operations MCQ Questions and Answers: Python Online Test
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