How to use lists in python | Full Python Course in Hindi by Hey Sushil

hey sushil рдХреЗ рдЗрд╕ рд╡рд┐рдбрд┐рдУ WHAT IS LIST IN PYTHON рдореЗ рдкрд╛рдЗрдерд╛рди рд▓рд┐рд╕реНрдЯ рдХреНрдпрд╛ рд╣реИ рдФрд░ рдЙрд╕рдореЗ рдХреНрдпрд╛ рдХреИрд╕реЗ рдХрд╛рдо рдХрд░рддрд╛ рд╣реИ рдФрд░ рдЙрд╕рдХреЗ рд╕рд╛рде рдХрдИ рд╕рд╛рд░реЗ рдкреЙрдЗрдВрдЯреНрд╕ рдкрд░ рдмрд╛рдд рдХрд┐рдпрд╛ рд╣реВрдБ:

  1. WHAT IS LIST IN PYTHON?
  2. KYA LIKST AUR ARRAY EK HI HAIN?
  3. LIST KA KAISE USE KIYA JAYE?
  4. PYTHON ME LIST KITNA IMPORTANT HAI?
  5. PYTHON LIST ME KITNE SUB METHODS HAI?
  6. PYTHON LIST ME SUB METHODS KE USE?
YouTube player
Python Collections (Arrays)
There are four collection data types in the Python programming language:
You need to understand all
List is a collection which is ordered and changeable. Allows duplicate members.
Tuple is a collection which is ordered and unchangeable. Allows duplicate members.
Set is a collection which is unordered and unindexed. No duplicate members.
Dictionary is a collection which is unordered, changeable and indexed. No duplicate members.
newlist = ['list','tuple','set','dictionay']
print('\nNew LIst => ',newlist)

'''
list
    new vale add kar sakete hai
    current value ko change 
    curernt value ko remove kar sakte hai    
'''

print('\nList 1st possition => ',newlist[1])
print('\nList 1st possition => ',newlist[-1])

# Range of Indexes
print('\nList 1st possition => ',newlist[1:3])
print('\nList 1st possition => ',newlist[-3:-1])
print('\nList 1st possition => ',newlist[1:])
print('\nList 1st possition => ',newlist[:3])

# Change Item Value
newlist[0] = 'new list'
print('\nNewlist value[0] => ',newlist[0])

# List Length
print('\nLen => ',len(newlist))
print('\nOld List => ',newlist)

# Add Items
newlist.append('Conditon')


# inset
newlist.insert(0,'list')

# Remove Item
newlist.remove('Conditon')

# pop()
newlist.pop()

# Copy a List
copylist = newlist.copy()

print('\nNew List Value => ',newlist)
# del
del newlist

# newlist = ['new list', 'tuple', 'set', 'dictionay']

# clear
secondlist = copylist.copy()
copylist.clear()

print('\nCopy List Value => ',copylist)

print('\nSecond List Value => ',secondlist)

# Join Two Lists
joinlist = ['join','new','list data']
secondlist.extend(joinlist)



print('\nJoin List => ',secondlist)

heySushil

Software Developer | Python | Data Science | Trainer | Motivation Speaker | Poetry | Animals Lover | Photographer |ЁЯзШЁЯП╗тАНтЩВя╕ПYoga | YouTube @heykyakaru

Leave a Reply

%d bloggers like this: