Week 3 - Section 1 - Data types and a bit of gaming
Chapter 4.1 - Lists
4.1 - Lists
So far we have seen three types of data :
and we learned that we can display the type of data with type function.
You can try the following to remember types :
>>> type(3)
>>> type(3.14)
>>> type("Hello")
We have also spoken about statements and we know that some are True and others are False. Try the following code :
>>> type(True) # without quotes
>>> type(False) # without quotes
This is another type of data called Boolean and could be one of this words.
List is another type of data. We have created lists using the command range. Then we created lists of numbers.
>>> list(range(1,11))
But a list can contain multiple data. Lets try an example with numbers:
>>> my_list = [1,33,18]
>>> print (my_list) # this is a list of numbers