CMPT 120 Lecture Notes - Lecture 19: Turtle Graphics

25 views2 pages
meghan78 and 39786 others unlocked
CMPT 120 Full Course Notes
29
CMPT 120 Full Course Notes
Verified Note
29 documents

Document Summary

Lecture 19 part 4: turtle graphics, and functions. Simply executes the statements it contains and then terminates. Executes the statements it contains, and then it returns a value back to the statement that called it. The input, int, and float functions are examples of value-returning functions. Functions are given names (like we give names to variables). Cannot use keywords as a function name. First character must be a letter or underscore. All other characters must be a letter, number or underscore. Function name should be descriptive of the task carried out by the function. Function: specifies what function does. def function_name(): statement statement: function header: first line of function. Includes keyword def and function name, followed by parentheses and colon: block: set of statements that belong together as a group, call a function to execute it. Interpreter jumps to the function and executes statements in the block. Interpreter jumps back to part of program that called the function.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents