Yes, you can use this code with any list. Simply assign your desired list to the my_list variable before executing the code.