Test Index

CBSE Class 12 Computer Science 2026 Paper Compartment Get it on Google PlayDownload on the App Store

© examsnet.com
Question : 5 of 37
Marks: +1, -0
What will be the output of the following statement ?
print("X"* 2,"Y",end = 2 * "X", sep = "#")
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: