• Save
  • Download
  • Clear Output
  • Runtime
  • Run All Cells
  • Difficulty Rating

Loading Runtime

Exercise 1 - Save an integer to a variable

Create a variable called integer_example and assign it any integer value that you want.

Exercise 2 - Save a float to a variable

Create a variable called float_example and assign it any float value that you want.

Exercise 3 - Check the type of integer_example

Use the type() function to check the type of the variable integer_example.

Save the result of the type() function to a new variable called integer_example_type.

If you print() out the value of integer_example_type you should see the text <class 'int'>. However, using the print function to check your work in this way is not a requirement of the exercise, it is optional.

Exercise 4 - Check the type of float_example

Use the type() function to check the type of the variable float_example.

Save the result of the type() function to a new variable called float_example_type.

If you print() out the value of float_example_type you should see the text <class 'float'>. However, using the print function to check your work in this way is not a requirement of the exercise, it is optional.