मराठी

Assertion (A): The expression "HELLO".sort() in Python will give an error. Reason (R): sort() does not exist as a method/function for strings in Python. - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Assertion (A): The expression "HELLO".sort() in Python will give an error.

Reason (R): sort() does not exist as a method/function for strings in Python.

पर्याय

  • Both (A) and (R) are true and (R) is the correct explanation for (A).

  • Both (A) and (R) are true and (R) is not the correct explanation for (A).

  • (A) is true but (R) is false.

  • (A) is false but (R) is true.

MCQ
विधान आणि तर्क

उत्तर

Both (A) and (R) are true and (R) is the correct explanation for (A).

Explanation:

The sort() function does not work for strings, hence the command will return an error. The claim and reason statements are true and logical. 

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2023-2024 (February) Set 4
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×