Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def function5(value):
- if value == 0:
- return random.randint(0,2)
- table = np.array([[1, 5, 2, 3], [3, 2, 1, 5], [4, 7, -6, 1], [6, 5, 3, -3]])
- possibilies =[]
- for x in range (0,len(table)):
- for y in range (0,len(table[x])):
- if table[x][y] == value:
- Dict = {'row':x,'column':y,'value':value }
- possibilies.append(Dict)
- if len(possibilies) == 1:
- return possibilies[0]['row']
- maximum = 0
- rowEND = 0
- for row in possibilies:
- if sum(table[row['row']])>maximum:
- maximum = sum(table[row['row']])
- rowEND = row
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement