In this Kata, you're to complete the function `sum_square_even_root_odd`.

You will be given a list of numbers, `nums`, as the only argument to the function. Take each number in the list and *square* it if it is even, or *square root* the number if it is odd. Take this new list and find the *sum*, rounding to two decimal places.

The list will never be empty and will only contain values that are greater than or equal to zero.

Good luck!

Difficulty: introductory

Starter code:

def sum_square_even_root_odd(nums):
	

Solutions:
def sum_square_even_root_odd(nums):
    return round(sum(n ** 2 if n % 2 == 0 else n ** 0.5 for n in nums), 2)

def sum_square_even_root_odd(nums):
    return round(sum(n**(0.5 if n % 2 else 2) for n in nums), 2)

sum_square_even_root_odd=lambda l:round(sum(x**[2,.5][x&1]for x in l),2)


def sum_square_even_root_odd(nums):
    return round(sum(a ** (2, 0.5)[a % 2] for a in nums), 2)


def sum_square_even_root_odd(nums):
    return round(sum(x**2 if x%2==0 else x**.5 for x in nums), 2)

import math

def sum_square_even_root_odd(nums):
    return float('%.2f' % sum([x*x if x%2 == 0 else math.sqrt(x) for x in nums]))


def sum_square_even_root_odd(l):
    return round(sum((n ** 2 if n % 2 == 0 else n ** 0.5) for n in l), 2)

def sum_square_even_root_odd(nums):
    return round(sum(n ** ((2 - n % 2) / (1 + n % 2)) for n in nums), 2)
    


def sum_square_even_root_odd(nums):
    return round(sum(i**[2,0.5][i&1] for i in nums),2)


def sum_square_even_root_odd(nums):
    return round(sum([x**0.5 if x%2 else x**2 for x in nums]),2)