# Error in randomized image loop

**URL:** <https://discourse.psychopy.org/t/error-in-randomized-image-loop/14421>\
**Category:** Builder\
**Tags:** randomization\
**Created:** [June 20, 2020, 5:20pm UTC](https://discourse.psychopy.org/t/error-in-randomized-image-loop/14421 "2020-06-20T17:20:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emmas](https://avatars.discourse-cdn.com/v4/letter/e/c2a13f/32.png) [@Emmas](https://discourse.psychopy.org/u/Emmas)\
**Post date:** [June 20, 2020, 5:20pm UTC](https://discourse.psychopy.org/t/error-in-randomized-image-loop/14421/1 "2020-06-20T17:20:26Z")

</div>

OS Win10  
PsychoPy version 2020.1.3

I’m trying to get 20 randomized images out of a list of 40 to appear in a learning loop, but I get the following error

typeError: int() argument must be a string, a bytes-like object or a number, not ‘NoneType’

I’ve watched a few videos to try and figure it out with no luck, can anyone help suggesting a fix? Thanks!

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [June 20, 2020, 9:52pm UTC](https://discourse.psychopy.org/t/error-in-randomized-image-loop/14421/2 "2020-06-20T21:52:36Z")

</div>

What is the code you are using (Python plus JS) in that routine?

Best wishes

Wakefield
