Python Variable Exercises Let’s check out some exercises that will help you understand Variables in Python better. Exercise 2-a Below is a good example of mixing numbers and text inside the print() function Assign: 3 to variable glass_of_water. #Type here. Assign a number to the variable: glass_of_water glass_of_water= print("I drank", glass_of_water, "glasses of water today.") ==== from unittest.gui import TestCaseGui class myTests(TestCaseGui): def testOne(self): self.assertEqual(glass_of_water,3,"variable checks") myTests().main() Hint 1 You can simply assign a number to the variable glass_of_water by typing it on the left side of the equal sign and the number on the right side of it. Hint 2 Number on the right side doesn’t have to be in quotes. Solution glass_of_water = 3 Exercise 2-b Let's try to see what happens after assigning a new value to our variable. Note that program gets executed line by line. Place the variable: glass_of_water inside the print function and observe what happens. #Fill the print function so it prints glass_of_water glass_of_water=3 glass_of_water=glass_of_water + 1 print() ==== from unittest.gui import TestCaseGui class myTests(TestCaseGui): def testOne(self): self.assertEqual(glass_of_water,4,"variable checks") myTests().main() Hint 1 Alternatively, you can use “+=” operator. It’s often a more efficient way of incrementing variables.You can read more about Python Operators here. Solution print (glass_of_water)