Q. What is the output of print(*[1, 2, 3], sep=’-‘)?

A
1-2-3
B
[1, 2, 3]
C
1 2 3
D
Error
Solution:

print(*[1, 2, 3], sep=’-‘) unpacks the list and joins with ‘-‘, outputting ‘1-2-3’.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!