Test Index

Python Revision Tour Get it on Google PlayDownload on the App Store CBSE Board Videos

© examsnet.com
Question : 17 of 102
Marks: +1, -0
What will be the output of the following statement ?
print("X"* 2,"Y",end = 2 * "X", sep = "#")
[CBSE 2026 Compartment]
Solution:  
Concept:
In print(), sep is placed between the values and end is printed after the last value (instead of the newline).
Explanation:
Values: "X"*2 = XX and "Y"
sep = "#" → XX#Y
end = 2*"X" = XX, added at the end → XX#YXX
Output:
XX#YXX
Answer:
Option D (XX#YXX)
© examsnet.com
Advertisements
Go to Question: