Jul-31-2021, 12:17 PM
def format_list(my_list): """ This function returns the words in the list which is in the even side. :param my_list: The list of the project. :type my_list: str, int, float :rtype: str, int, float :return: The result of the list on the even only. """ if len(my_list) % 2 == 0: return my_list[0::2] print(format_list(my_list=["hydrogen", "helium", "lithium", "beryllium", "boron", "magnesium"]))oh wait , I changed something and now its worked.
i removed the my_list = []
why did it suddnely work?