My grandfather always predicted how old people would get, and right before he passed away he revealed his secret!

In honor of my grandfather's memory we will write a function using his formula!

* Take a list of ages when each of your great-grandparent died.  
* Multiply each number by itself.  
* Add them all together.  
* Take the square root of the result.  
* Divide by two.

## Example

```R
predict_age(65, 60, 75, 55, 60, 63, 64, 45) == 86
```
```python
predict_age(65, 60, 75, 55, 60, 63, 64, 45) == 86
```

Note: the result should be rounded down to the nearest integer.

Some random tests might fail due to a bug in the JavaScript implementation. Simply resubmit if that happens to you.

Difficulty: EASY
Tags: Fundamentals

Starter code:
def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	

Solutions:
def predict_age(*ages):
	return sum((a * a for a in ages)) ** 0.5 // 2


def predict_age(*age):
	return sum((a * a for a in age)) ** 0.5 // 2


import numpy as np

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	return np.sum(np.array([age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]) ** 2) ** 0.5 // 2


import math

def predict_age(*args):
	return math.sqrt(sum((x * x for x in args))) // 2


from numpy import linalg as LA

def predict_age(*ages):
	return LA.norm(ages) // 2


predict_age = lambda *a: sum((e * e for e in a)) ** 0.5 // 2


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	sum = 0
	listik = [age_1 ** 2, age_2 ** 2, age_3 ** 2, age_4 ** 2, age_5 ** 2, age_6 ** 2, age_7 ** 2, age_8 ** 2]
	for i in listik:
		sum += i
	return int(sum ** (1 / 2) // 2)


import math

def predict_age(*ages):
	return int(math.sqrt(sum((age * age for age in ages))) / 2)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	arr = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	result = int(math.sqrt(sum([i ** 2 for i in arr])) / 2)
	return result


def predict_age(*argv):
	return sum((x * x for x in argv)) ** (1 / 2) // 2


def predict_age(*ages):
	return int(sum((age * age for age in ages)) ** 0.5 / 2)


def predict_age(*age):
	return sum([i ** 2 for i in age]) ** 0.5 // 2


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age_1 = age_1 ** 2
	age_2 = age_2 ** 2
	age_3 = age_3 ** 2
	age_4 = age_4 ** 2
	age_5 = age_5 ** 2
	age_6 = age_6 ** 2
	age_7 = age_7 ** 2
	age_8 = age_8 ** 2
	total = age_1 + age_2 + age_3 + age_4 + age_5 + age_6 + age_7 + age_8
	total = math.sqrt(total)
	return int(total / 2)


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	import math
	oldAge = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	newAge = []
	y = 0
	x = 0
	z = 0
	r = 0
	for i in range(0, len(oldAge)):
		newAge.append(oldAge[i] * oldAge[i])
	z = sum(newAge)
	y = math.sqrt(z)
	r = y / 2
	x = math.floor(r)
	print(x)
	return x


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	list1 = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	list2 = []
	for x in list1:
		list2.append(x * x)
	list_sum = sum(list2)
	list_sum2 = math.sqrt(list_sum) / 2
	print(int(list_sum2))
	return int(list_sum2)
predict_age(65, 60, 75, 55, 60, 63, 64, 45)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	return int(math.sqrt(sum([age ** 2 for age in locals().values()])) / 2)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	return math.floor(math.sqrt(age_1 ** 2 + age_2 ** 2 + age_3 ** 2 + age_4 ** 2 + age_5 ** 2 + age_6 ** 2 + age_7 ** 2 + age_8 ** 2) / 2.0)


from math import sqrt

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	s = sum([x * x for x in [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]])
	return sqrt(s) // 2


def predict_age(a1, a2, a3, a4, a5, a6, a7, a8):
	ages = [a1, a2, a3, a4, a5, a6, a7, a8]
	return sum([el ** 2 for el in ages]) ** 0.5 // 2


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	new_list = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	mult_list = math.sqrt(sum([i ** 2 for i in new_list])) // 2
	return mult_list


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	sum = 0
	sum += age_1 ** 2 + age_2 ** 2 + age_3 ** 2 + age_4 ** 2 + age_5 ** 2 + age_6 ** 2 + age_7 ** 2 + age_8 ** 2
	return sum ** 0.5 // 2


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	ages = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	sum = 0
	for i in ages:
		sum = sum + i ** 2
	return math.floor(math.sqrt(sum) / 2)


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age_multiplied_and_added = age_1 ** 2 + age_2 ** 2 + age_3 ** 2 + age_4 ** 2 + age_5 ** 2 + age_6 ** 2 + age_7 ** 2 + age_8 ** 2
	age_multiplied_and_added_and_squared = age_multiplied_and_added ** 0.5
	return int(age_multiplied_and_added_and_squared / 2)


from math import sqrt

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	sum = 0
	sum = age_1 * age_1 + age_2 * age_2 + age_3 * age_3 + age_4 * age_4 + age_5 * age_5 + age_6 * age_6 + age_7 * age_7 + age_8 * age_8
	sum = sqrt(sum) / 2
	return int(sum)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	ages = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	return int(math.sqrt(sum((x * x for x in ages))) / 2)


def predict_age(*age):
	lt = [i * i for i in age]
	return int(sum(lt) ** 0.5 / 2)


from math import sqrt, floor

def predict_age(a1, a2, a3, a4, a5, a6, a7, a8):
	ages = [a1, a2, a3, a4, a5, a6, a7, a8]
	return floor(sqrt(sum([x * x for x in ages])) / 2)


import math

def predict_age(q, w, e, r, t, y, u, i):
	x = [q, w, e, r, t, y, u, i]
	for (i, j) in enumerate(x):
		x[i] = j * j
	return int(str(math.sqrt(sum(x)) / 2).split('.')[0])


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	total = 0
	for i in range(0, len(age)):
		multi_itself = age[i] * age[i]
		total = total + multi_itself
	square_root = pow(total, 0.5)
	return int(square_root / 2)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age = 0
	return math.sqrt(pow(age_1, 2) + pow(age_2, 2) + pow(age_3, 2) + pow(age_4, 2) + pow(age_5, 2) + pow(age_6, 2) + pow(age_7, 2) + pow(age_8, 2)) // 2


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	return math.sqrt(sum([age_1 ** 2, age_2 ** 2, age_3 ** 2, age_4 ** 2, age_5 ** 2, age_6 ** 2, age_7 ** 2, age_8 ** 2])) // 2


import math

def predict_age(a1, a2, a3, a4, a5, a6, a7, a8):
	l = [a1 ** 2, a2 ** 2, a3 ** 2, a4 ** 2, a5 ** 2, a6 ** 2, a7 ** 2, a8 ** 2]
	return int(math.sqrt(sum(l)) / 2)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	all_ages = []
	all_ages.extend([age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8])
	x = 0
	for age in all_ages:
		age = age * age
		x += age
	y = math.sqrt(x)
	return int(y / 2)


def predict_age(*xs):
	return int(sum(map(lambda x: x ** 2, xs)) ** 0.5 / 2)


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	n = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	s = sum([el * el for el in n])
	return s ** 0.5 // 2


import math

def predict_age(a1, a2, a3, a4, a5, a6, a7, a8):
	s = 0
	s += a1 * a1 + a2 * a2 + a3 * a3 + a4 * a4 + a5 * a5 + a6 * a6 + a7 * a7 + a8 * a8
	s = math.sqrt(s)
	return s // 2


import math

def predict_age(*ages):
	return math.sqrt(sum((i * i for i in ages))) // 2


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	ages = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	value = 0
	for age in ages:
		sqw = age * age
		value += sqw
	value = value ** 0.5
	value = int(value // 2)
	return value


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	ages = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	new_ages = []
	for i in ages:
		x = i * i
		new_ages.append(x)
	step3 = sum(new_ages)
	step4 = step3 ** (1 / 2)
	step5 = step4 // 2
	return step5


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	ages = (age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8)
	suma = 0
	result = 0
	for age in ages:
		suma += age * age
	result = math.sqrt(suma) // 2
	return result


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	l = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	m = int(sum([i * i for i in l]) ** 0.5 / 2)
	return m
print(predict_age(65, 60, 75, 55, 60, 63, 64, 45))


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	return sum(map(lambda x: x * x, [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8])) ** 0.5 // 2


import math

def predict_age(*args):
	return int(math.sqrt(sum((a * a for a in args))) / 2)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	list = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	grand_secret = 0
	for age in list:
		grand_secret = grand_secret + age ** 2
	grand_secret = math.sqrt(grand_secret)
	grand_secret = grand_secret / 2
	return int(grand_secret)


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	import math
	x = age_1 ** 2 + age_2 ** 2 + age_3 ** 2 + age_4 ** 2 + age_5 ** 2 + age_6 ** 2 + age_7 ** 2 + age_8 ** 2
	return math.floor(x ** 0.5 / 2)


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	return int(sum((i ** 2 for i in age)) ** 0.5 / 2)


def predict_age(*args):
	return sum([age ** 2 for age in args]) ** 0.5 // 2


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age_list = []
	squares = []
	age_list.append(age_1)
	age_list.append(age_2)
	age_list.append(age_3)
	age_list.append(age_4)
	age_list.append(age_5)
	age_list.append(age_6)
	age_list.append(age_7)
	age_list.append(age_8)
	for i in age_list:
		multiply = i ** 2
		squares.append(multiply)
	add = sum(squares)
	answer = math.sqrt(add) / 2
	round_answer = int(round(answer, 2))
	return round_answer


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age = int((age_1 ** 2 + age_2 ** 2 + age_3 ** 2 + age_4 ** 2 + age_5 ** 2 + age_6 ** 2 + age_7 ** 2 + age_8 ** 2) ** 0.5 / 2)
	return age


from math import sqrt

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	age2 = []
	age3 = 0
	for i in age:
		age2.append(i * i)
	for i in age2:
		age3 += i
	return int(sqrt(age3) / 2)


from math import sqrt

def predict_age(*ages):
	a = [pow(x, 2) for x in ages]
	a = sum(a)
	a = sqrt(a)
	a = a // 2
	return a


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age1 = age_1 ** 2
	age2 = age_2 ** 2
	age3 = age_3 ** 2
	age4 = age_4 ** 2
	age5 = age_5 ** 2
	age6 = age_6 ** 2
	age7 = age_7 ** 2
	age8 = age_8 ** 2
	sumofages = age1 + age2 + age3 + age4 + age5 + age6 + age7 + age8
	sqrtofage = sumofages ** 0.5
	final = sqrtofage / 2
	return math.floor(final)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	sum_mult = age_1 * age_1 + age_2 * age_2 + age_3 * age_3 + age_4 * age_4 + age_5 * age_5 + age_6 * age_6 + age_7 * age_7 + age_8 * age_8
	result = math.floor(math.sqrt(sum_mult) / 2)
	return result


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	ages = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	ages1 = []
	for age in ages:
		age *= age
		ages1.append(age)
	age_sm = sum(ages1)
	return math.floor(math.sqrt(age_sm) / 2)


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	li = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	b = [x ** 2 for x in li]
	return int(sum(b) ** 0.5 / 2)


def predict_age(a, b, c, d, e, f, g, h):
	return sum((i ** 2 for i in [a, b, c, d, e, f, g, h])) ** 0.5 // 2


def predict_age(*args):
	return sum((x * x for x in args)) ** (1 / 2) // 2


def predict_age(*args):
	result = 0
	for el in args:
		result += el * el
	return result ** (1 / 2) // 2


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	z = []
	z.append(age_1)
	z.append(age_2)
	z.append(age_3)
	z.append(age_4)
	z.append(age_5)
	z.append(age_6)
	z.append(age_7)
	z.append(age_8)
	y = []
	for i in z:
		y.append(i * i)
	x = sum(y)
	x = math.sqrt(x)
	return x // 2


from math import *

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	a = age_1 * age_1
	b = age_2 * age_2
	c = age_3 * age_3
	d = age_4 * age_4
	e = age_5 * age_5
	f = age_6 * age_6
	g = age_7 * age_7
	h = age_8 * age_8
	i = a + b + c + d + e + f + g + h
	j = sqrt(i)
	h = floor(j / 2)
	return h


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	a = age_1 * age_1 + age_2 * age_2 + age_3 * age_3 + age_4 * age_4 + age_5 * age_5 + age_6 * age_6 + age_7 * age_7 + age_8 * age_8
	b = a ** 0.5
	return int(b // 2)


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	import math
	a = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	b = []
	for x in a:
		b.append(x * x)
	s = sum(b)
	s = math.sqrt(s)
	s = s / 2
	return int(s)


def predict_age(*ages):
	return int(sum((i * i for i in ages)) ** 0.5 / 2)


from math import sqrt

def predict_age(*ages):
	result = []
	for n in ages:
		result.append(n * n)
	return sqrt(sum(result)) // 2


def predict_age(*args):
	sum = 0
	for i in args:
		sum += i * i
	return sum ** 0.5 // 2


import math

def predict_age(*args):
	res = 0
	for i in args:
		res += i * i
	return math.floor(math.sqrt(res) / 2)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age_1 = age_1 * age_1
	age_2 = age_2 * age_2
	age_3 = age_3 * age_3
	age_4 = age_4 * age_4
	age_5 = age_5 * age_5
	age_6 = age_6 * age_6
	age_7 = age_7 * age_7
	age_8 = age_8 * age_8
	output = age_1 + age_2 + age_3 + age_4 + age_5 + age_6 + age_7 + age_8
	output = math.sqrt(output)
	a = output // 2
	return math.floor(a)


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	starting_list = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	each_muliply_itself = []
	for age in starting_list:
		each_muliply_itself.append(age * age)
	total_multiplied_ages = sum(each_muliply_itself)
	square_root_result = total_multiplied_ages ** 0.5
	result = square_root_result / 2
	return int(result)


from functools import reduce
import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	ages = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	res = math.sqrt(sum([x * x for x in ages]))
	return int(res / 2)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	list = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	squared_list = [a ** 2 for a in list]
	added_squared_list = math.sqrt(sum(squared_list)) / 2
	return int(added_squared_list)


from math import sqrt

def predict_age(*ages):
	return int(sqrt(sum(map(lambda x: x ** 2, ages))) / 2)


from math import sqrt

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	ages = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	return int(sqrt(sum(map(lambda x: x ** 2, ages))) / 2)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	lst = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	second = []
	summ = 0
	for age in lst:
		first = age * age
		second.append(first)
	for product in second:
		summ += product
	summ = math.sqrt(summ)
	answer = summ / 2
	return int(answer)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	k = age_1 ** 2
	n = age_2 ** 2
	g = age_3 ** 2
	l = age_4 ** 2
	t = age_5 ** 2
	j = age_6 ** 2
	i = age_7 ** 2
	e = age_8 ** 2
	b = k + n + g + l + t + j + i + e
	return math.sqrt(b) // 2


import math

def predict_age(a1, a2, a3, a4, a5, a6, a7, a8):
	array = [a1, a2, a3, a4, a5, a6, a7, a8]
	return int(math.sqrt(sum((x ** 2 for x in array))) / 2)


def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	sum_ages = 0
	ages = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	for x in ages:
		sum_ages += x ** 2
	swaureroot = sum_ages ** (1 / 2)
	return int(swaureroot / 2)


import math

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	ls = (age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8)
	return int(math.sqrt(sum([num * num for num in ls])) / 2)


def predict_age(*args):
	return int(sum((n * n for n in args)) ** 0.5 // 2)


from math import floor

def predict_age(age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8):
	age = [age_1, age_2, age_3, age_4, age_5, age_6, age_7, age_8]
	return floor(sum((i ** 2 for i in age)) ** 0.5 / 2)