English

Identify the invalid Python statement out of the following options: (A) print("A", 10, end="*")(B) print("A", sep="*", 10)(C) print("A", 10, sep="*")(D) print("A" * 10) - Computer Science (Python)

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?
2024-2025 (March) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×