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?
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