Create a function move-zeros which takes as parameter a list


Problem

Create a function move_zeros which takes as parameter a list of integers and moves all zeros to the end of the list. For example, if the list is [1, 0, 3, 0, 0, 5, 7] the result should be [1, 3, 5, 7, 0, 0, 0]

Prepare THREE solutions

1. move_zeros_v1 uses another tmp list to calculate the new list and returns it as the result (easy problem). The initial list is not changed.

2. move_zeros_v2 modify the initial list inside the function. The function returns nothing.

3. move_zeros_v3 moves the elements in the initial list without using temporary lists (more difficult problem). The function returns nothing. You can use a temporary variable to swap two items, but you can use the Python swap a,b=b,a

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Create a function move-zeros which takes as parameter a list
Reference No:- TGS03345570

Expected delivery within 24 Hours