1# example of list in python
2
3myList = [9, 'hello', 2, 'python']
4
5print(myList[0]) # output --> 9
6print(myList[-3]) # output --> hello
7print(myList[:3]) # output --> [9, 'hello', 2]
8print(myList) # output --> [9, 'hello', 2, 'python']
9
1# empty list
2my_list = []
3
4# list of integers
5my_list = [1, 2, 3]
6
7# list with mixed data types
8my_list = [1, "Hello", 3.4]
1#Creating lists
2my_list = [1, "Hello", 3.4, 0, "World"]
3my_nested_list = [['Hello', 'World'],[47,39]]
4
5#Accessing lists
6my_list[1] # Hello
7my_list[-2] # 0
8my_list[:3] # [1, "Hello", 3.4]
9my_nested_list[1] #[47,39]
10my_nested_list[0][1] # World
1# list with numbers
2list = [10, 20, 30]
3# list with strings
4list = ["john", "kai", "albert"]
5# mixed data
6list = ["john",1 ,True ]