a = 5
b = 3Variables - Answer Key
Exercise 1
- Create two new variables called
a, that has the value of 5, andb, that has the value of 3.
- Subtract
bfromaand assign it to the new variable calleddifference
difference = a - b- Using the variables
a,banddifference, print out the sentence that looks like:
The difference of 5 and 3 is 2
print("The difference of", a, "and", b, "is", difference)The difference of 5 and 3 is 2
Exercise 2
- How would you determine the data type on
your_numberand what data type is it?
type(your_number)float
Reuse
CC-BY-4.0