ميـــحرلا نحنحنرلا للوللوا مــسب
Fundamentals of Programming
Python
Session # 4
By: Saeed Haratian Spring 2016
Python Session # 4 By: Saeed Haratian Spring 2016 Outlines - - PowerPoint PPT Presentation
Fundamentals of Programming Python Session # 4 By: Saeed Haratian Spring 2016 Outlines turtle Module The for Loop turtle methods and tricks Functions turtle Module
Session # 4
By: Saeed Haratian Spring 2016
turtle Module The for Loop turtle methods and tricks Functions
Screen
mainloop bgcolor title
Turtle
forward left color pensize
for i in [0,1,2,3]: alex.forward(50) alex.left(90) for i in range(4): alex.forward(50) alex.left(90)
for c in ["yellow", "red", "purple", "blue"]: alex.color(c) alex.forward(50) alex.left(90) clrs = ["yellow", "red", "purple", "blue"] for c in clrs: alex.color(c) alex.forward(50) alex.left(90)
Turtle
backward right penup pendown speed shape stamp
Syntax :
def NAME( PARAMETERS ): STATEMENTS
Some Functions Require Parameter like abs, pow, max Fruitful Function Void Function
create a local variable inside a function only exists inside the function cannot use it outside