# Code from Tutorial doesnt work

**URL:** <https://forum.toplap.org/t/code-from-tutorial-doesnt-work/1650>\
**Category:** Foxdot\
**Created:** [3 February 2021 18:16 UTC](https://forum.toplap.org/t/code-from-tutorial-doesnt-work/1650 "2021-02-03T18:16:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Holz](https://forum.toplap.org/user_avatar/forum.toplap.org/holz/32/875_2.png) [@Holz](https://forum.toplap.org/u/Holz)\
**Post date:** [3 February 2021 18:16 UTC](https://forum.toplap.org/t/code-from-tutorial-doesnt-work/1650/1 "2021-02-03T18:16:18Z")

</div>

Hey guys,  
i copied that straight out of the tutorial, but it doesnt work for me. can u please help me. thanks!

def update(n=0):  
if 0 \> n \> 4:  
d1 \>\> play("x ")  
elif 4 \> n \> 20:  
d1 \>\> play(“x-”)  
else:  
d1.stop()  
return  
Clock.future(1, update, args=(n + 1,))

# Start the process by calling the function

update()

---

<div class="post-metadata">

**Author:** ![KittyClock](https://forum.toplap.org/user_avatar/forum.toplap.org/kittyclock/32/886_2.png) [@KittyClock](https://forum.toplap.org/u/KittyClock)\
**Post date:** [4 February 2021 16:10 UTC](https://forum.toplap.org/t/code-from-tutorial-doesnt-work/1650/2 "2021-02-04T16:10:34Z")

</div>

What exactly is not working? Do you see any errors? Is your indentation correct?

---

<div class="post-metadata">

**Author:** ![Holz](https://forum.toplap.org/user_avatar/forum.toplap.org/holz/32/875_2.png) [@Holz](https://forum.toplap.org/u/Holz)\
**Post date:** [4 February 2021 20:33 UTC](https://forum.toplap.org/t/code-from-tutorial-doesnt-work/1650/3 "2021-02-04T20:33:42Z")

</div>

For me the solution was:

def update(n=-1):  
if 0 \< n \< 4:  
d1 \>\> play("x ")  
elif 4 \< n \< 20:  
d1 \>\> play(“x-”)  
else:  
d1.stop()  
return  
Clock.future(1, update, args=(n + 1,))

# Start the process by calling the function

update()
