 Apr 2019

runestone.academy runestone.academy

The "nonfruitful function" got me really confused here.

 Jan 2019

runestone.academy runestone.academy

additive identity and multiplicative identity
The "Additive Identity" is 0, because adding 0 to a number does not change it:
a + 0 = 0 + a = a
The "Multiplicative Identity" is 1, because multiplying a number by 1 leaves it unchanged:
a × 1 = 1 × a = a

def square(x): runningtotal = 0 for counter in range(x): runningtotal = runningtotal + x
return runningtotal
The indentation of return runningtotal is very important because I made a mistake by indenting it to 4 more spaces and the code wasn't working**


runestone.academy runestone.academy

All I know is that when I use a synthesizer to make music, a sine wave is used to produce a particular sound... Now, to reproduce that sine wave by drawing it with a turtle is a completely different matter.

setworldcoordinates
I know what this does but I just can't understand how to make the turtle behave like a sine wave


runestone.academy runestone.academy

randrange
What is the difference between randrange and randint?


runestone.academy runestone.academy

<class '__main__.Turtle'>
This is what I get when I print a variable which contains a turtle. However, with a python ide called Thonny, the output is different
<class 'turtle.Turtle'> (The code is here but for some weird reason it cannot be seen!). The output for the class is just turtle.Turtle
I wonder why...
