# Scenario

**_Several people_** are standing in *a row divided into two teams*.  
The **_first person_** goes into **_team 1_**, **_the second_** goes into **_team 2_**, **_the third_** goes into **_team 1_**, and so on.
___
# Task

**_Given_** *an array of positive integers (the weights of the people)*, **_return_** *a new array/tuple of two integers*, **_where_** **_the first_** one is the **_total weight of team 1_**, and **_the second_** one is the **_total weight of team 2_**.
___
# Notes 

* **_Array size_** is *at least 1*.
* **_All numbers_** will be **positive**.
___
# Input >> Output Examples 

```
rowWeights([13, 27, 49])  ==>  return (62, 27)
```

## **_Explanation_**:

**_The first element_** `62` is *the total weight of team 1*, and **_the second element_** `27` is *the total weight of team 2*.
___
```
rowWeights([50, 60, 70, 80])  ==>  return (120, 140)
```
## **_Explanation_**:

**_The first element_** `120` is *the total weight of team 1*, and **_the second element_** `140` is *the total weight of team 2*.
___
```
rowWeights([80])  ==>  return (80, 0)
```
## **_Explanation_**:

**_The first element_** `80` is *the total weight of team 1*, and **_the second element_** `0` is *the total weight of team 2*.
___
___
___

# [Playing with Numbers Series](https://www.codewars.com/collections/playing-with-numbers)

# [Playing With Lists/Arrays Series](https://www.codewars.com/collections/playing-with-lists-slash-arrays)

# [For More Enjoyable Katas](http://www.codewars.com/users/MrZizoScream/authored)
___

## ALL translations are welcomed

## Enjoy Learning !!
# Zizou

Difficulty: introductory

Starter code:

def row_weights(array):
	

Solutions:
def row_weights(array):
    return sum(array[::2]), sum(array[1::2])


def row_weights(array):
    evens = sum(i for index, i in enumerate(array) if index%2==0)
    return (evens, sum(array)-evens)

row_weights = lambda arr: (sum(arr[::2]), sum(arr[1::2]))

def row_weights(array):
    a = array[::2]
    b = array[1::2]
    return sum(a),sum(b)

def row_weights(array):
    odd = 0
    even = 0
    for i in range(len(array)):
        if i%2 == 0:
            odd += array[i]
        else:
            even += array[i]
    return odd, even

def row_weights(lst):
    return (sum(lst[i] for i in range(0, len(lst), 2)),)+(sum(lst[j] for j in range(1, len(lst), 2)),)

def row_weights(array):
    return (sum(array[0::2]), sum(array[1::2]))

def row_weights(array):
    return sum(x for i, x in enumerate(array) if not i % 2), sum(x for i, x in enumerate(array) if i % 2)

def row_weights(array):
    t1 = 0
    t2 = 0
    for i, n in enumerate(array):
        if i%2==0:
            t1+=n
        else:
            t2+=n
    return t1, t2

def row_weights(array):
    '''Calculate team 1 weights and team 2 weights
    separately, then return.'''
    
    # Team 1 weight
    team_1 = sum([array[x] for x in range(len(array)) if x % 2 == 0])
    
    # Team 2 weight
    team_2 = sum([array[x] for x in range(len(array)) if x % 2 != 0])
    
    # Return statement
    return(team_1, team_2)


row_weights = lambda x: (sum(x[::2]),sum(x[1::2]))

def row_weights(array):
    even = []
    odd = []
    for i,el in enumerate(array):
        if i % 2 == 0:
            even.append(el)
        else:
            odd.append(el)
    return sum(even), sum(odd)

def row_weights(array):
    y = 2
    team1,team2 = 0,0
    
    for i in array:
        if y%2==0:
            team1 += i   
            y+=1
        else:
            team2 += i   
            y+=1    
    return (team1,team2)        

def row_weights(array):
    group1 = []
    group2 = []
    for i in range(len(array)):
        if not i % 2:
            group1.append(array[i])
        else:
            group2.append(array[i])
    return (sum(group1), sum(group2))
    


def row_weights(array):
    team1 = team2 = 0
    for i in range(len(array)):
        if i % 2 == 0:
            team1 += array[i]
        else:
            team2 += array[i]
    
    return team1, team2

def row_weights(array):
    one , two = 0 , 0
    for i,n in enumerate(array):
        if i % 2: 
            two += n
        else:
            one += n
    return (one,two)


def row_weights(array):
    res = 0
    res2 = 0
    for i in range(len(array)):
        if i%2 != 0:
            res += array[i]
        elif i%2 == 0:
            res2 += array[i]
    return (res2,res)

def row_weights(array):
    team1 = sum([array[i] for i in range(0, len(array), 2)])
    team2 = sum([array[i] for i in range(1, len(array), 2)])
    
    return (team1, team2)


def row_weights(array):
    team1 = [el for i, el in enumerate(array) if i % 2 ==0]
    team2 = [el for i, el in enumerate(array) if i % 2 !=0]
    return sum(team1), sum(team2)

def row_weights(array):
    team1 = 0
    team2 = 0
    for i in range(0,len(array)):
        if i % 2 == 0:
            team1 = team1 + array[i]
        else:
            team2 = team2 + array[i]
    return team1,team2

def row_weights(array):
    #numbers are switched because I am "smart" and lazy. idk anymore man, it works.
    team2 = 0
    team1 = 0    
    for i in range(len(array)):
        if i == 0:
            team1 = team1 + array[i]
            team2 = team2
        elif i % 2 != 0 and i > 0:
            team2 = team2 + array[i]
        elif i % 2 == 0 and i > 0:
            team1 = team1 + array[i]
            
    return (team1, team2)


def row_weights(array):
    team_1 = []
    team_2 = []
    for i, el in enumerate(array):
        if i%2 == 0:
            team_1.append(el)
        else:
            team_2.append(el)
    return sum(team_1), sum(team_2)

def row_weights(array):
    return (sum(n for i, n in enumerate(array) if not i % 2), sum(n for i, n in enumerate(array) if i % 2))

def row_weights(array):
    return sum(n for i,n in enumerate(array) if i%2 == 0), sum(n for i,n in enumerate(array) if i%2)

def row_weights(array):
    return (sum([array[x] for x in range(len(array)) if x % 2 == 0]), sum([array[x] for x in range(len(array)) if x % 2 == 1]))

def row_weights(array):
    team1 = []
    team2 = []
    e = 0
    if len(array) % 2 != 0 or len(array) == 1:
        array.append(0)
    for i in str(array):
        if e == len(array):
            break
        else:
            team2.append(array[e+1])
            team1.append(array[e])
            e += 2
    return sum(team1), sum(team2)


def row_weights(arr):
    even = sum([el for i, el in enumerate(arr) if i % 2 == 0])
    odd= sum([el for i, el in enumerate(arr) if i % 2 == 1])
    return even,odd

def row_weights(array):
    odd= 0
    even =0
    for i in range(len(array)):
        if i%2==0:
            odd += array[i]
        elif i%2==1:
            even += array[i]
    return odd,even
            


def row_weights(array):
    evens = []
    odds = []
    for i, el in enumerate(array):
        if i % 2 == 0:
            evens.append(el)
        else:
            odds.append(el)
    return sum(evens), sum(odds)

def row_weights(array):
    team1 = []
    team2 = []
    for i,el in enumerate(array):
        if i % 2 == 0:
            team1.append(el)
        else:
            team2.append(el)
    return sum(team1), sum(team2)

def row_weights(array):
    evens = []
    odd = []
    for i, el in enumerate(array):
        if i % 2 == 0:
            evens.append(el)
        else:
            odd.append(el)
    return sum(evens),sum(odd)

def row_weights(arr):
    s = sum([el for i, el in enumerate(arr) if i % 2 == 0])
    return s, sum(arr) - s

def row_weights(array):
    x= sum(  [  array[i]   for i in range(len(array)) if i%2==1  ])
    y= sum(  [  array[i]   for i in range(len(array)) if i%2==0  ]) 
    return (y,x)

def row_weights(array):
    team1 = 0
    team2 = 0
    for x in range(0,len(array)):
        if x % 2 == 0:
            team1 = team1 + array[x]
        else:
            team2 = team2 + array[x]
    return (team1, team2)

def row_weights(array):
    command_1 = array[0::2]
    command_2 = array[1::2]
    return sum(command_1), sum(command_2)

def row_weights(array):
    team_1 = []
    team_2 = []
    
    for idx, num in enumerate(array):
        if idx % 2 != 0:
            team_2.append(num)
        else:
            team_1.append(num)
            
    return sum(team_1), sum(team_2)

def row_weights(array):
    
    first_team = 0
    second_team = 0
    
    for x in range(len(array)):
        
        if x % 2 == 0 :
            first_team += array[x]
        else:
            second_team += array[x]
            
    return (first_team, second_team)       
        


def row_weights(array):
    c=[]
    a=0
    b=0
    for i in range(len(array)):
        if i==0 or i%2==0:
            a=a+array[i]
        else:
            b=b+array[i]
    c.append(a)
    c.append(b)
    return tuple(c)
            
            
            
            


def row_weights(array):
    lista = []
    lista2 = []
    for i in range(0,len(array),2):
        lista.append(array[i])
    for i in range(1,len(array),2):
        lista2.append(array[i])
    convert = sum(i for i in lista)
    convert2 = sum(i for i in lista2)
    return ((convert, convert2))
    
    
    

   
   
    


def row_weights(array):
    
    x = 0
    t1 = []
    t2 = []
    
    for i in array:
        if x%2==0:
            t1.append(i)
        else:
            t2.append(i)
        x+=1
    
    return (sum(t1), sum(t2))

def row_weights(array):
    #your code here
    a=array[::2]
    ba=array[1::2]
    return (sum(a),sum(ba))

def row_weights(array):
    a=0
    b=0
    for i in range(len(array)):
        if i%2==1:
            a=a+array[i]
        elif i%2==0:
            b=b+array[i]
    return (b,a)        
                


def row_weights(array):
    a=0
    b=0
    for i,e in enumerate(array):
        if i%2==0:
            a+=e
        else:
            b+=e
    return (a, b)

def row_weights(array):
    first=[]
    second=[]
    for i,v in enumerate(array):
        if i%2:
            first.append(v)
        else:
            second.append(v)
    return (sum(second),sum(first))

def row_weights(array):
    arr = [0, 0]
    for i in range(len(array)):
        if i % 2 == 0:
            arr[0] += array[i]
        else:
            arr[1] += array[i]
    return arr[0], arr[1]

def row_weights(num):
    r = []
    for i in enumerate(num, start=1):
        r.append(i)
    d = dict(r)
    t1 = [d[i] for i in list(d.keys()) if i%2 == 1]
    t2 = [d[i] for i in list(d.keys()) if i%2 == 0]
    return sum(t1), sum(t2)


def row_weights(array):
    t1,t2 = 0,0
    for i in range(len(array)):
        if i % 2 : t2 += array[i]
        else: t1 += array[i]
    return t1,t2

def row_weights(array):
    t1w = 0
    t2w = 0
    for pos in range(0,len(array)):
        if pos % 2 == 0:
            t1w += array[pos]
        else:
            t2w += array[pos]
    return (t1w, t2w) 

def row_weights(A):
    return sum(e for i, e in enumerate(A) if not i%2), sum(e for i, e in enumerate(A) if i%2)

def row_weights(array):
    x = [sum([array[i] for i in range(len(array)) if i%2 == j]) for j in range(2)]
    if len(array) < 3:
        x = x[:2]
    return tuple(x)

def row_weights(array):
    return (sum(j for i, j in enumerate(array) if i % 2 == 0), sum(j for i, j in enumerate(array) if i % 2 != 0))

def row_weights(l):
    s = [0,0]
    for i in range(len(l)):
        if i % 2 == 0:
            s[0] += l[i]
        else:
            s[1] += l[i]
    return tuple(s)

def row_weights(array):
    sum1 = sum([array[i] for i in range(len(array)) if i % 2 == 0])
    sum2 = sum([array[i] for i in range(len(array)) if i % 2 != 0])
    return (sum1,sum2)

def row_weights(array):
    if len(array) == 1:
        return (array[0], 0)
    
    one = 0
    two = 0
    
    
    for i in range (len(array)):
        if i%2 == 0:
            one += array[i]
        else:
            two += array[i]
            
    return (one, two)

def row_weights(arr):
    a = 0
    b = 0
    for i in range(len(arr)):
        if i % 2 == 0:
            b += arr[i]
        else:
            a += arr[i]
    return (b,a)

def row_weights(array):
    ans = [0 , 0]
    for index in range(0, len(array)):
        if index % 2 == 0:
            ans[0] += array[index]
        else:
            ans[1] += array[index]    
    return tuple(ans)


def row_weights(array):
    first = 0
    second = 0
    for i, weight in enumerate(array):
        if i % 2 == 0:
            first += weight
        else:
            second += weight
    return first, second

def row_weights(array):
    output = [0, 0]
    if len(array) == 1:
        output[0] += array[0]
        return tuple(output)
    else:
        for i in range(0,len(array)):
            if i % 2 == 0:
                output[0]+=array[i]
            else: 
                output[1]+=array[i]
    return tuple(output)

def row_weights(array):
    even = 0
    odd = 0
    for num in range(len(array)):
        if num % 2 == 0:
            even += array[num]
          
        else:
            odd += array[num]
         
            
        
    return even,odd
    
    #your code here


def row_weights(a):
    return (sum([x[1] for x in enumerate(a) if x[0]%2==0]),
            sum([x[1] for x in enumerate(a) if x[0]%2!=0]))

def row_weights(array):
    totals = [0,0]
    for int, x in enumerate(array):
        if int % 2 == 0:
            totals[0]+= x
        else:
            totals[1] += x
    return tuple(totals)

def row_weights(array):
    s1,s2=0,0
    for i in range(0,len(array)):
        if (i+1)%2==1:
            s1+=array[i]
        else:
            s2+=array[i]
            
    return (s1,s2)

def row_weights(array):
    first_command = 0
    second_command = 0
    for index, value in enumerate(array, 1):
        if index % 2 == 0:
            second_command += value
        else:
            first_command += value
    return first_command, second_command

def row_weights(array):
    team1 = []
    team2 = []
    for i in range(len(array)):
        if i % 2 == 0:
            team1.append(array[i])
        else:
            team2.append(array[i])
    weight_team1 = sum(team1)
    weight_team2 = sum(team2)
    return (weight_team1, weight_team2)

def row_weights(array):
    total_weights_even = 0
    total_weights_odd = 0
    for i in range(len(array)):
        if i % 2 == 0:
            total_weights_even += array[i]
        else:
            total_weights_odd += array[i]
    return (total_weights_even, total_weights_odd)

def row_weights(array):
    total_weights_even = 0
    total_weights_odd = 0
    for i in range(0, len(array), 2):
        total_weights_even += array[i]
    for j in range(1, len(array), 2):
        total_weights_odd += array[j]
    return (total_weights_even, total_weights_odd)

def row_weights(array):
    return sum(array[i] for i in range(0, len(array), 2)), sum(array[j] for j in range(1, len(array), 2))

def row_weights(array):
    team_1 = []
    team_2  = []
    for i, num in enumerate(array):
        if i %2 ==0:
            team_1.append(num)
        if i %2 ==1:
            team_2.append(num)
    return sum(team_1), sum(team_2)


def row_weights(l):
    li_eve=[]
    li_odd=[]
    for i in range(0,len(l)):
        if i%2==0:
            li_eve.append(l[i])
        else:
            li_odd.append(l[i])
    
    return(sum(li_eve),sum(li_odd))


def row_weights(array):
    team_sec = []
    team_frst = []
    for index, item in enumerate(array):
        if index % 2 == 0:
            team_frst.append(item)
        else:
            team_sec.append(item)
    return sum(team_frst), sum(team_sec)

def row_weights(array):
    team1 = 0
    team2 = 0
    
    i = 0
    while i < len(array):
        if i % 2 == 0:
            team1 = team1 + array[i]
        else:
            team2 = team2 + array[i]
        i = i + 1
    
    return (team1,team2)

def row_weights(array):
    first = [0]
    second = [0]
    for i in range(0,len(array)):
        if i % 2 == 0:
            first.append(array[i])
        else:
            second.append(array[i])
    return sum(first),sum(second)

def row_weights(array):

    one = [array[i] for i in range(0, len(array), 2)]
    two = [array[i] for i in range(1, len(array), 2)]

    return sum(one), sum(two)

def row_weights(array):
    w1,w2 = [0],[0]
    for key,i in enumerate(array): w1.append(i) if key%2== 0 else w2.append(i)
    return (sum(w1),sum(w2))

def row_weights(array):
    a1, a2 = [], []
    row = [ a1.append(array[i]) if i % 2 == 0 else a2.append(array[i]) for i in range(len(array)) ]
    return sum(a1), sum(a2)

def row_weights(array):
    t1 = t2 = 0
    for i in range(len(array)):
        if i % 2 != 0:
            t2 += array[i]
        else:
            t1 += array[i]
    return (t1, t2)

def row_weights(array):
    sum1=sum2=0
    for i in range(len(array)):
        if i%2==0:
            sum1=sum1+array[i]
        else:
            sum2=sum2+array[i]
    return (sum1,sum2)

def row_weights(array):
    sum1=sum(array[i] for i in range(0,len(array),2))
    return (sum1,sum(array)-sum1)

def row_weights(array):
    a,b=0,0
    for  i in range(0,len(array),2):
        a+=array[i]
    for  j in range(1,len(array),2):
        b+=array[j]
    return a,b

def row_weights(array):
    team1 = 0
    team2 = 0
    for index, value in enumerate(array, 1):
        if index % 2 == 0:
            team2 += array[index-1]
        else:
            team1 += array[index-1]
    return team1, team2

def row_weights(array):
    return sum(array[x] for x in range(0,len(array)) if x%2==0),sum(array[x] for x in range(0,len(array)) if x%2!=0)

def row_weights(array):
    w1 = sum(array[i] for i in range(len(array)) if i % 2 == 0)
    w2 = sum(array[i] for i in range(len(array)) if i % 2 == 1)
    return w1, w2


def row_weights(a):
    b = sum(a[0::2])
    d = sum(a[1::2])
    c = (b , d)
    return c
    #your code here


def row_weights(array):
    first, second = 0, 0
    for i, el in enumerate(array, 1):
        if i % 2 == 0:
            first += el
        else:
            second += el
    return (second, first)


def row_weights(array):
    return (sum(array[0::2]), sum(array[1::2])) if len(array) > 1 else (array[0], 0)

def row_weights(array):
    sum1 = 0
    sum2 = 0
    
    for idx, i in enumerate(array):
        if idx % 2 == 0:
            sum1 += i
        else:
            sum2 += i
            
    return (sum1, sum2)            

def row_weights(array):
    #create totals for each team
    total1 = 0
    total2 = 0
    #loop through array
    for x in range(len (array)):
        if x%2 ==1: #if odd number index, add to team2
            total2+= array[x]
        else: #add to team1
            total1+= array[x]
    #combine results in a tuple
    return tuple((total1, total2))
    



def row_weights(array):
    team_1_weight = sum(array[0::2])
    team_2_weight = sum(array[1::2])
    total_weights_tuple = (team_1_weight, team_2_weight)
    return total_weights_tuple

def row_weights(array):
    #your code here
    #if len(array)==1:
        #return (array[0],0)
    one=0
    two=0
    for s,i in enumerate(array,1):
        if s%2==0:
            two+=i
        else:
            one+=i
    return (one,two)

def row_weights(array):
    lst = []
    lst1= []
    for i in range(len(array)):
        if i%2==0:
            lst.append(array[i])
        else:
            lst1.append(array[i])
    return sum(lst),sum(lst1)


def row_weights(array):
    #your code here
    a = sum(array[i] for i in range(len(array)) if i%2==0)
    b = sum(array[i] for i in range(len(array)) if i%2!=0)
    return (a,b)

def row_weights(a):
    first=0
    second=0
    for i in range(len(a)):
      if i%2==0:
        first+=a[i]
      else: second += a[i]
    return (first, second)

def row_weights(array):
    if len(array) == 1:
        return (array[0],0)
    x = []
    y = []
    for i in range(0,len(array)-1,2):
        x.append(array[i])
        y.append(array[i+1])
    if len(array) % 2 != 0:
        x.append(array[-1])
    return (sum(x),sum(y))

def row_weights(array):
    """
    Returns a tuple of total weights for 'team 1' and 'team 2,' where
    the first person of array is in team 1, the second team 2, the third
    in team 1, etc...
    
    Args:
        array: List of at least two positive integers, which represents 
        peoples' weights.
    Returns:
        tuple of total weights of team 1 and 2.
    """
    weight_t1 = sum(array[i] for i in range(0, len(array), 2))
    weight_t2 = sum(array[i] for i in range(1, len(array), 2))
    return (weight_t1, weight_t2)

def row_weights(array):
  odd=[]
  even=[]
  for i in range(len(array)):
    if i % 2 == 0:
      even.append(array[i])
      print(even)
    else:
      odd.append(array[i])
      print(odd)
  x=sum(odd)
  y=sum(even)
  return (y,x)

def row_weights(array):
    a = 0
    b = 0
    
    for i, x in enumerate (array):
        if i%2 == 0:
            a = a + x
        else:
            b = b + x
    return a,b

def row_weights(array):
    
    team1 = list()
    team2 = list()
    
    for c,e in enumerate(array):
        if c % 2 == 0:
            team1.append(e)
        else:
            team2.append(e)
            
    return (sum(team1), sum(team2))

def row_weights(array):
    even_index=[]
    odd_index=[]
    even_weight=0
    odd_weight=0
    for idx in range(len(array)):
        if idx%2!=0:
            odd_index.append(idx)
        else:
            even_index.append(idx)
    for i in even_index:
        even_weight+=array[i]
    for i in odd_index:
        odd_weight+=array[i]
        #if array.index(i) in even_index:
            #even_weight+=i
        #else:
            #odd_weight+=i
    return even_weight,odd_weight 

def row_weights(array):
    counter_1 = 0
    counter_2 = 0
  
    for x in range(len(array)):
        if x % 2 ==0:
            counter_1 += array[x]
        else:
            counter_2 += array[x]
    return (counter_1, counter_2)