Lesson 17 of 34
List Methods: जोडा, काढा, Sort करा
9 min 25 XP
append() शेवटी जोडते, insert() ठराविक जागी जोडते, remove() एक value काढते, आणि pop() शेवटचा item बाहेर काढते.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.संख्यांच्या list साठी sum(), max() आणि min() खूप उपयोगी. sort() लहान ते मोठे लावते; sort(reverse=True) उलटे.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.एका ओळीतून अनेक संख्या वाचण्यासाठी: input().split() strings ची list देते; प्रत्येक int मध्ये बदला.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.