Hi Friends, welcome to yet another interesting session on Python List Comprehension. Today we will see another way to fill a list with its elements. In previous sessions, we have seen that we can add elements in a list using ‘append’ and ‘insert’ method. …

Hi Friends……Welcome again to our session on Methods in Python Lists. In the previous session, we had a detailed understanding about Python Lists. We will extend this session now to see how we can make use of the lists and some pre-defined methods and functions to be used with Python Lists.

Lets start our session on Methods in Python Lists:

1. sort method on integers — Python Lists provides us with an in-build method to sort the list. Instead of sorting the list by manually comparing list elements one by one, we can directly make use of sort function.

list = [10,5,67,34,7] print("Actualy list is:",list) list.sort() print("Sorted list is:",list)

Read More Methods at this link: Methods in Python Lists — Python Tutorials (mytechdevice.com)

More posts on Python: Amit Mathur | Python Programming Blog

Let’s talk today about the most interesting difference between Java and Python. Java vs Python: We have heard that Java is compiled language and Python is interpreted language. Although this is true to some sense but this does not means that Java does not have interpretation step or Python does…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store