MY PYTHON PROGRAMMING JOURNEY ON BLURT - DAY 3

in technology •  3 years ago 

MY python programming journey on blurt.jpg

Lists

Lists are usually put in square brackets because they can be updated in the future. A list looks something like” [‘victor’, ‘Michael’, ‘Mary’]”. The items in the list are identified by index. For example, the index of the first item on the list is 0, the second is 1, the third is 3… and so on.

Input

names = [‘John’, ‘Sandra’, ‘Ben’]
print(names[2])

Output

For the above example, the output will be ‘Ben’ because it is the second index. 'Ben'

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!