Interview Question

What is print() function?

print() writes object representations with configurable separators and endings.

💡 Concept ✅ Quick Revision 🐍 Python

Answer

print() writes the string representations of objects to a text stream. • sep controls the separator between objects. • end controls what follows the output. • file can direct output to another text stream.

💡 Simple Example

print('Python', '3', sep='-', end='!\n')

Output

Python-3!

⚡ Quick Revision

print() writes object representations with configurable separators and endings.