मराठी

Select the correct output of the code: S="Amrit Mahotsav @ 75" A=S.partition (" ") print(a) - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Select the correct output of the code:

S="Amrit Mahotsav @ 75"
A=S.partition (" ")
print(a)

पर्याय

  • (‘Amrit Mahotsav’, ‘@’, ‘75’)
  • [‘Amrit’, ‘Mahotsav’, ‘@’, ‘75’]
  • (‘Amrit’, ‘Mahotsav @ 75’)
  • (‘Amrit’, “, ‘Mahotsav @ 75’)
MCQ
Advertisements

उत्तर

(‘Amrit’, “, ‘Mahotsav @ 75’)

Explanation:

The partition() method looks for the first occurrence of the specified string and divides the string into a tuple with three elements. In this case, the specified string is a space (" "), so:

  • The first element includes the part before the specified string (space).
  • The second element contains the specified string itself (space).
  • The third element holds the part after the specified string (space).
shaalaa.com
Read and Write a CSV File Using Python
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2022-2023 (March) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×