
def merge(line):
    """
    Function that merges a single row or column in 2048.
    """
    l = len(line)
    s1 = [0]*l
    j = 0
    for i in range(l):
    	if l[i] != 0:
    		s1[j] = l[i]

    return []

a = [2,0,2,4]

print merge(a)

def merge(line):
    """
    Function that merges a single row or column in 2048.
    """
    l = len(line)
    s1 = [0]*l
    j = 0
    for i in range(l):
        if line[i] != 0:
            s1[j] = line[i]
            j += 1
    return s1

a = [2,0,2,4]

print (merge(a))
Modify the correct merge 1 fct
Modify the correct merge 1 fct

  
  def merge(line):
      """
      Function that merges a single row or column in 2048.
      """
      l = len(line)
      s1 = [0]*l
      j = 0
      for i in range(l):
-     	if l[i] != 0:
+         if line[i] != 0:
-     		s1[j] = l[i]
- 
+             s1[j] = line[i]
+             j += 1
-     return []
+     return s1
  
  a = [2,0,2,4]
  
- print merge(a)
+ print (merge(a))
Modify the correct merge 1 fct
## Code Before:

def merge(line):
    """
    Function that merges a single row or column in 2048.
    """
    l = len(line)
    s1 = [0]*l
    j = 0
    for i in range(l):
    	if l[i] != 0:
    		s1[j] = l[i]

    return []

a = [2,0,2,4]

print merge(a)
## Instruction:
Modify the correct merge 1 fct
## Code After:

def merge(line):
    """
    Function that merges a single row or column in 2048.
    """
    l = len(line)
    s1 = [0]*l
    j = 0
    for i in range(l):
        if line[i] != 0:
            s1[j] = line[i]
            j += 1
    return s1

a = [2,0,2,4]

print (merge(a))