Answers for "how to use lists python"

5

lists in python

lst = ["abc", 34, True, 40, "male"]
for i in lst:
	print(i)
Posted by: Guest on March-17-2021
2

how to make lists in python

blah = [uchoose,etc.]
Posted by: Guest on January-01-2021
1

list inside a list in python

# it appends a list into a list
list1 = [1,2,3,4,5]
list1.append([6,7])
# ouput = [1, 2, 3, 4, 5, [6, 7]]
Posted by: Guest on May-14-2020
2

python dlist

#this is how  to create a list:
#I named it mylist, but you can name it whatever you like

myList = [1,2,3,4,5]
print(myList[0]) # this will print the first element of the list
print(myList[1]) #this will print the second element of the list
print(myList[2])#and so on
print(myList[3])
print(myList[4])
Posted by: Guest on April-08-2020

Code answers related to "how to use lists python"

Python Answers by Framework

Browse Popular Code Answers by Language