IFB104 Lecture Notes - Lecture 2: Turtle Graphics, Scripting Language
Document Summary
Topic 2 - how to use pre-defined functions. In this unit we do this using python as a simple scripting language for teaching purposes. methods are special functions applicable to classes (values of certain types) and are called with the first argument preceding the function name using dot notation. Some functions do both of these actions (turtle"s "stamp" method draws an image and returns an identifier for the image) Some functions like the built-in "round" function allow some arguments to be optional. Some functions like the built-in "sorted" function allow us to specify which arguments we wish to provide by their name. More character string operations: we have seen that numeric operations such as + or * work with character strings, all of these operations return a new string, leaving the original one unchanged. Some other commonly used string operations are shown on the right.