Breaking down (decomposing) your code is splitting it into more functions.
BREAK DOWN (Decompose)
symbol or container that holds a value.
Variables
A function that prints a prompt and retrieves text from the user.
We can ask the user to enter a word, phrase, or number but in order to use a number, we need to convert it to an integer, using the command
Breaking a large code up into functions
TOP DOWN DESIGN
When we write variable_name = value we are
Defining a Variable
The correct way to ask a user for a color and store the answer as a variable
user_color = input("Give a color: ")
variable_name = input(“ “)
Saves user input
is a brief explanation of code in plain English.
Pseudocode
Variables must always be _____ before they are used
Defined
The correct way to collect a number from the user to use for the radius of a circle?
radius = int(input("What is the radius?: "))
variable_name = int()
Changes the type of a value to an integer
Breaking your program into smaller parts.
Decomposition
The following variable_name = value
Defining a Variable
This cannot be used for variable as it is an existing command
Color
variable_name = input(“ “) and variable_name = int()
Commands
TOP DOWN DESIGN
YOUR TEAM HAS EARNED 500 POINTS
Which line of code changes the variable?
1 circle_radius = 50
2
3 penup()
4 forward(100)
5 pendown()
6 circle(circle_radius * 25)
6
TRUE OR FALSE:
We cannot ask the user to enter a word, phrase, or number that we can store in a variable to be used in our program.
FALSE