Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to use list in python

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
Comment

Python list function tutorial

list1 = [10, 20, 4, 45, 99]
 
mx=max(list1[0],list1[1])
secondmax=min(list1[0],list1[1])
n =len(list1)
for i in range(2,n):
    if list1[i]>mx:
        secondmax=mx
        mx=list1[i]
    elif list1[i]>secondmax and 
        mx != list1[i]:
        secondmax=list1[i]
 
print("Second highest number is : ",
      str(secondmax))
      
 Output:-     
      
Second highest number is :  45
Comment

python list example

List = [1, 2, 3, "GFG", 2.3]
print(List)
Comment

Python list tutorial

Vowel=['a','e','i','o','u']
if 'e' in Vowel:
print('Present')
else:
print('absent')
Comment

PREVIOUS NEXT
Code Example
Python :: list vs tuple 
Python :: stack python 
Python :: Find the path of python executable 
Python :: pandas df number of columns 
Python :: simple bmi calculator using python 
Python :: tf dataset 
Python :: length of queue python 
Python :: Set .difference() Operation in python3 
Python :: length of an empty array in python 
Python :: nlp spacy medium 
Python :: python variables and data types 
Python :: python module search 
Python :: python string to uppercase 
Python :: map in python 3 
Python :: Code example of Python Modulo Operator 
Python :: catching exceptions in python 
Python :: python print text 
Python :: os.path.sep.join 
Python :: how to search for a specific character in a part of a python string 
Python :: adding array to array python 
Python :: pytest use fixture without running any tests 
Python :: crud python 
Python :: python print font size 
Python :: python dictionaries 
Python :: add python to path windows 10 
Python :: how to change title font size in plotly 
Python :: names of all methods in class introspect pythonm 
Python :: python programming online editor 
Python :: why is python so populair 
Python :: Second step creating python project 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =