N
# example of list in python
myList = [9, 'hello', 2, 'python']
print(myList[0]) # output --> 9
print(myList[-3]) # output --> hello
print(myList[:3]) # output --> [9, 'hello', 2]
print(myList) # output --> [9, 'hello', 2, 'python']
N
thislist = ["apple", "banana", "cherry"]
print(thislist[1])
N
# empty list
my_list = []
# list of integers
my_list = [1, 2, 3]
# list with mixed data types
my_list = [1, "Hello", 3.4]
N
myfavouritefoods = ["Pizza", "burgers" , "chocolate"]
print(myfavouritefoods[1])
#or
print(myfavouritefoods)
N
lst = ["abc", 34, True, 40, "male"]
for i in lst:
print(i)