Variables for Numbers Flashcards
There are two correct answers for this one. Answer with either one. What is this?
number or integer
Type the illegal character in this variable name.
2nd_runner_up
2
Assign the number 5 to the variable players
players = 5
Assign the negative number -6 to the variable loss
loss = -6
What is the value of total?
number = 10
total = number + 2
12
Assign a number (your choice) to the variable total.
total = 15
Assign a negative integer to a variable. You choose the integer and the variable name.
loss = -1030
What is this (one word, lowercase)?
“-8.087”
string
Add two variables and assign the result to a third variable. Make up all the variable names.
total = merch_total + shipping
Add 5 to the variable running_total and assign the result to the same variable
running_total = running_total + 5