Advertisements
Advertisements
Question
Identify the invalid Python statement out of the following options:
Options
print("A",10,end="*")print("A",sep="*",10)print("A",10,sep="*")print("A"*10)
MCQ
Advertisements
Solution
print("A",sep="*",10)
Explanation:
When using the sep parameter in the print() function, all the values to be printed must be listed first, followed by the sep keyword argument. Option print("A",sep="*",10) is invalid because sep is placed before all positional arguments are provided.
shaalaa.com
Is there an error in this question or solution?
