I made this project in python: https://colab.research.google.com/drive/1Spx0sE9u24dBszDA319vFIao37tkhnAQ#scrollTo=i9n5yqAKErIs then translated it into scratch: https://scratch.mit.edu/projects/1060841770/ so that's the reason you might get a ValueError