Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: empty range for randrange() #2

Closed
p-j-r opened this issue Apr 19, 2020 · 0 comments · Fixed by #3
Closed

ValueError: empty range for randrange() #2

p-j-r opened this issue Apr 19, 2020 · 0 comments · Fixed by #3
Labels
good first issue Good for newcomers

Comments

@p-j-r
Copy link
Owner

p-j-r commented Apr 19, 2020

In function first_case()
corona_walk

cx,cy= nodes[randrange(len(nodes))] 
temp=Lat.nodes[(cx,cy)]['walkers']        

This may potentially return an empty attribute as no walker may be at that node!

first_case=temp[randrange(len(temp))]   
infect[first_case]=1
Lat.nodes[(cx,cy)]['infected']+=1
global sick
sick=1
@p-j-r p-j-r added the good first issue Good for newcomers label Apr 19, 2020
@p-j-r p-j-r pinned this issue Apr 19, 2020
@p-j-r p-j-r unpinned this issue Apr 21, 2020
@p-j-r p-j-r linked a pull request Apr 21, 2020 that will close this issue
@p-j-r p-j-r closed this as completed in #3 Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant