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]
Answers:
Try this:
LIST[:int(len(LIST) * 0.75)]
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]
Try this:
LIST[:int(len(LIST) * 0.75)]