You have already come across values in Python, these are things like `“Hello World!”` or the number `15`. All values in Python are objects that belong to a specific data type. Mastering these data types (which are universally used in many programming languages) is key to mastering a programming language.
Python has many data types and data structures built in. In this assignment you will explore the four important date types: `string`, `integer`, `float` and `bool`.
For this assignment, create a Python script called `types.py`. In this script, you must use Python’s built in `type()` function in a print statement to explore the type of the values you put in. Try these out yourself:
-!- CODE language-bash -!-$ python3 types.py
<class 'str'>
<class 'float'>
<class 'bool'>
<class 'str'>
CodeGrade is your virtual teaching assistant for your coding classroom. You teach, CodeGrade takes care of the rest.
With our 40+ built-in fully automatically graded Introduction to Python assignments for university-level courses, you can start teaching Python at your institution with confidence now. Or, scale your classroom with CodeGrade's tools.
Book a personal 30-minute demo now and we'll show you how to get started with CodeGrade in less than 1 hour!