How to make a new list from a list which is 3/4th the size of the original one in python?

Question:

Ex. I have a list

LIST=[1,2,3,3,4,4,5,9]

Now, I want to create a list which is 3/4th of this list

[1,2,3,3,4,4]
Asked By: vaibhav

||

Answers:

Try this:

LIST[:int(len(LIST) * 0.75)]
Answered By: Harshal Parekh
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.