Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

list programs in python

#Lists python
a=[4,66,0,4.005,'hana']
print(a).........[4,66,0,4.005,'hana']

a[3]......4.005
#here 3 will be counted from 0 that is 4th term from left.

#examples
my_list = [4,5,6]
my_list = ['3',' 2', '3']
my_list = [5.025, 20.902, 0.3]

seller = ['apple', 'banana', 'avocado'] # the list
new_item = 'kiwi' # new item in the store
seller.append(new_item) # now it's have been added to the list


myfavouritefoods = ["Pizza", "burgers" , "chocolate"]
print(myfavouritefoods[1])
print(myfavouritefoods)

fruits = ["apple", "banana", "cherry"]
print(fruits)
fruits[0]
fruits[:2]
print(*fruits,sep="
")
Comment

PREVIOUS NEXT
Code Example
Python :: import from parent directory python 
Python :: insert blank row in data frame 
Python :: docstring in python 
Python :: python post request multi argument 
Python :: if in python 
Python :: add vertical line in plot python 
Python :: how to convert str to int python 
Python :: max value of a list prolog 
Python :: num2words python 
Python :: double underscore methods python 
Python :: how to add pagination in discord.py 
Python :: matplotlib multiple bar plot 
Python :: discord bot python get message id 
Python :: unknown amount of arguments discord py 
Python :: Replace an item in a python list 
Python :: aws lambda logging with python logging library 
Python :: python add list 
Python :: flask form options 
Python :: reaction role discord.py 
Python :: clear 
Python :: python ignore first value in generator 
Python :: Python list append tutorial 
Python :: merge list elements python 
Python :: How to split a string into a dictionary in Python 
Python :: run python file from cmd 
Python :: positional only arguments python 
Python :: data encapsulation in python 
Python :: python linkedin api 
Python :: args in python 
Python :: matrix multiplication python without numpy 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =