Lesson 32 of 34
Methods: Objects-ന് എന്ത് ചെയ്യാനാകും
10 min 35 XP
Class-നുള്ളിൽ എഴുതുന്ന functions-നെ methods എന്ന് വിളിക്കുന്നു. അവയുടെ ആദ്യ parameter എപ്പോഴും self ആണ്. Method-ന് object-ന്റെ data വായിക്കാനും മാറ്റാനും കഴിയും.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.__str__ method ഉണ്ടെങ്കിൽ print(object) സൗഹൃദപരമായ ടെക്സ്റ്റ് കാണിക്കും.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.