Python beginners rus
From Wiki
Contents |
[edit]
part 1
[edit]
source code
5+5==10
return True
5+5==5
return False
if 4*4 == 16: print " super " else: print " bad "
return super
if 5+5==15: print " super " else: pinrt " bad"
return bad
Angela * 4
returns an error
" Angela " * 150
returns Angela 150 times in a pretty pattern (see picture at the right)
[edit]
part 2
[edit]
source code
import xturtle for x in range(20): xturtle.fd(60) xturtle.left(60)
Note: You can replace xturtle with turtle. If you do so, use turtle.forward(distance) instead of xturtle.fd(distance)

