diff --git a/HacktoberFestContribute/move_all_zeros_to_array_end.py b/HacktoberFestContribute/move_all_zeros_to_array_end.py new file mode 100644 index 000000000..ba169c6b3 --- /dev/null +++ b/HacktoberFestContribute/move_all_zeros_to_array_end.py @@ -0,0 +1,8 @@ +# Contribution from Santanu Bhattacharjee +# My GitHub account - https://github.com/santanu94 + +def move_zero_to_end(array = [5,0,2,0,3,0,4]): + array.sort(key= lambda x: True if x == 0 else False, reverse= False) + return array + +print(move_zero_to_end([0,0,0,2,6,22,5,34,76,'a','tgf',65,0,'c'])) \ No newline at end of file