1
2
3
4
5
6
7
8
9
10
11
12
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to Trinket.
Post a review on Amazon for the paperback or the Kindle edition.
Email me to give me a compliment, complaint, or correction. I'll respond.
0,1,2,3,4,5,6,7,8,9,10,11
0
0
0
0
Rewrite this so total equals 10. | total = "4" + 6 | total = 4 + 6 | ^ *total = 4 \+ 6 *$ |
What is the value of third_number? | first_number = 5 second_number = 6 third_number = first_number * second_number | 30 | ^ *30 *$ |
Divide 12 by the decimal .5 and assign the result to the variable outcome | outcome = 12 / .5 | outcome `= `12 `/ `.5 | |
Divide the variable total by 3 and assign the result to the variable each_share. | each_share = total / 3 | each_share = total / 3 | |
Subtract one number from another and assign the result to a variable. Make up the numbers and the variable name. | left_over = 1345 - 801 | ^ *.* = [-]?(?:[.]\d+|\d+(?:[.]\d*)?) - [-]?(?:[.]\d+|\d+(?:[.]\d*)?) *$ | |
Divide one variable by another and assign the result to a third variable. Make up the variable names. | this = that / the_other | ^ *.* = .* \/ .* *$ | |
Subtract a variable from a number and assign the result to a second variable. Make up the variable names and the number. | result = 1000 - discount | ^ *.* = [-]?(?:[.]\d+|\d+(?:[.]\d*)?) - .* *$ | |
Multiply a variable by itself and assign the result to the same variable. Make up the variable name. | growing_number = growing_number * growing_number | ^ *(.*) = \1 \* \1 *$ | |
Multiply three numbers and assign the result to a variable. Make up the numbers and the variable name. | result = 5 * 6 * 7 | ^ *.* = [-]?(?:[.]\d+|\d+(?:[.]\d*)?) \* [-]?(?:[.]\d+|\d+(?:[.]\d*)?) \* [-]?(?:[.]\d+|\d+(?:[.]\d*)?) *$ | |
In one line of code, display the result of multiplying two variables. Make up the variable names. | print(first_number * second_number) | ^ *print\(.* \* .*\) *$ | |
| 67462da9d4 | ||
| 989da53d04 |