Django Python str() argument 2 must be str, not int

Published: 5/10/2017
Django Python str() argument 2 must be str, not int
Source: STACKOVERFLOW.COM

I have a 12x12 dictionary with values, which are 0 for all. matchfield = {} for i in range(12): for j in range(12): matchfield[str((i, j))] = 0 I want to set some values to 1 with the following snippet (it checks whether the surrounding fields are free): length = 4 m = randint(1, 10-length) n = randint(1, 10) for x in range(m-1, m+length+1): for y in range(n-1, n+1): if not matchfield[str((x, y))]

Read more
Related news
Comment