# Demo entry 6679229

**py**

Submitted by **anonymous**
on Dec 06, 2017 at 16:31

Language: Python. Code size: 593 Bytes.

def limit(grad): list = [0]*500 for i in grad: for j in i: if j != 0: list[0] = list[0] + 1 list[int(j)] = list[int(j)] + 1 print list high = int(list[0]*0.8) low = int(list[0]*0.5) print high, low sum = 0 low_limit=0 high_limit = 0 for i in range(1,len(list)): sum = sum + list[i] print sum if sum<=low and sum+list[i+1] >low: low_limit = i if sum >= high : high_limit = i break return high_limit,low_limit

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.