We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf47129 commit 5d27c99Copy full SHA for 5d27c99
Manipulating List/Building A List from Scratch.py
@@ -0,0 +1,14 @@
1
+# We can create an empty list and then add elements using the append method
2
+
3
+var = list() # creating an empty list
4
+var.append('apple') # adding 'apple' to the list through the append method
5
+# The list stays in order and new elements are added at the end of the list by default
6
+var.append(120) # adding 120 to the list through the append method
7
+print (var) # printing the list
8
9
10
11
+var.append('Orange')
12
+var.append(180)
13
+print (var) # printing the list again after adding the above two new elements
14
0 commit comments