17. Write a python function to print out and remove every third items in the list a as provided until remove all the items in the list a.
The output is:
list_a = ['python', 'exercise', 'tutorial', 'practice', 'free', 'numpy', 'pandas']
Expected Answer:
tutorial
numpy
exercise
pandas
free
python
practice
Sample Answer:
def remove_terms(info):
position = 3 - 1
i = 0
len_info = (len(info))
while len_info>0:
i = (position+i)%len_info
print(info.pop(i))
len_info -= 1
list_a = ['python', 'exercise', 'tutorial', 'practice', 'free', 'numpy', 'pandas']
remove_terms(list_a)
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)