a = [6,5,4,4,2,1,10,1,2,48]
s = set(a) # used to convert any of the list/tuple to the distinct element and sorted sequence of elements
# Note: above statement will convert list into sets
print sorted(s)[1]
More Related Contents:
- How on earth does this code work
- What’s the correct way to convert bytes to a hex string in Python 3?
- What exactly does the .join() method do?
- Python analog of PHP’s natsort function (sort a list using a “natural order” algorithm) [duplicate]
- multiple axis in matplotlib with different scales [duplicate]
- BeautifulSoup – search by text inside a tag
- What is __pycache__?
- Splitting a semicolon-separated string to a dictionary, in Python
- Get the string within brackets in Python
- Child processes created with python multiprocessing module won’t print
- Python recursion permutations
- How to get current time in python and break up into year, month, day, hour, minute?
- Pandas – Number of Months Between Two Dates
- Python 3 print() function with Farsi/Arabic characters [duplicate]
- How to plot data from multiple two column text files with legends in Matplotlib?
- View RDD contents in Python Spark?
- How can I get Selenium Web Driver to wait for an element to be accessible, not just present?
- Big-O of list slicing
- Is it possible to modify a variable in python that is in an outer (enclosing), but not global, scope?
- How to add group labels for bar charts
- Converting images to csv file in python
- Adding a string to a list using augmented assignment
- How do I raise the same Exception with a custom message in Python?
- Python pandas integer YYYYMMDD to datetime
- Difference between consecutive elements in list [duplicate]
- How to test that variable is not equal to multiple things?
- Python list([]) and []
- Install Beautiful Soup using pip [duplicate]
- Anaconda unicode error on command line startup on Windows
- Converting .py to .ui file [duplicate]