filmov
tv
Python Tutorial | Python List | Add Items in the list | Remove Items in list | Join Items in List

Показать описание
In this video, You will learn Python Programming Language.
# Python List
"# Add Items in the list:"
"# append() method: add a item to the end of list"
# Mylist = [10, "India", -50, 30.22, True ]
# print(Mylist)
"# insert method: add item to the specific index"
# Mylist = [10, "India", -50, 30.22, True]
# print(Mylist)
"# Remove Items in list:"
"# remove method: specific item will be removed"
"# If duplicate items are present in the list then" \
"remove method will remove first item in the list"
# Mylist = [10, "India", -50, 30.22, True, 10, 10]
# print(Mylist)
"# pop method: remove specific index from list"
# Mylist = [10, "India", -50, 30.22, True, 10, 10]
# print(Mylist)
# print(Mylist)
"# In pop method, if you do not specify the index then" \
"it remove the last item from the list"
# Mylist = [10, "India", -50, 30.22, True]
# print(Mylist)
"# clear method: empty the list"
# Mylist = [10, "India", -50, 30.22, True]
# print(Mylist)
"# Copy Items in List:"
"# copy method: Will copy list from one to another"
# Mylist = [10, "India", -50, 30.22, True]
# print(CopyMylist)
"# list method:"
# Mylist = [10, "India", -50, 30.22, True]
# CopyMylist = list(Mylist)
# print(CopyMylist)
"# Join Items in List:"
"# Using + Operator:"
# city = ["Lucknow", "Mumbai", "Bangalore"]
# state = ["UP", "Maharastra", "Karnataka"]
# address = city + state
# print(address)
"# append method:"
# city = ["Lucknow", "Mumbai", "Bangalore"]
# state = ["UP", "Maharastra", "Karnataka"]
# for i in state:
# print(city)
"# extend method"
# city = ["Lucknow", "Mumbai", "Bangalore"]
# state = ["UP", "Maharastra", "Karnataka"]
# print(city)
"# sort method: arrange values in ascending order"
# Pincode = [10,20,30, 90, 60, 40, 80, 30]
# print("Asending:", Pincode)
# print("Descending:",Pincode)
"# reverse method"
Pincode = [10,20,30, 90, 60, 40, 80, 30]
print(Pincode)
"# Python Tuples:"
See the next video...
# Python List
"# Add Items in the list:"
"# append() method: add a item to the end of list"
# Mylist = [10, "India", -50, 30.22, True ]
# print(Mylist)
"# insert method: add item to the specific index"
# Mylist = [10, "India", -50, 30.22, True]
# print(Mylist)
"# Remove Items in list:"
"# remove method: specific item will be removed"
"# If duplicate items are present in the list then" \
"remove method will remove first item in the list"
# Mylist = [10, "India", -50, 30.22, True, 10, 10]
# print(Mylist)
"# pop method: remove specific index from list"
# Mylist = [10, "India", -50, 30.22, True, 10, 10]
# print(Mylist)
# print(Mylist)
"# In pop method, if you do not specify the index then" \
"it remove the last item from the list"
# Mylist = [10, "India", -50, 30.22, True]
# print(Mylist)
"# clear method: empty the list"
# Mylist = [10, "India", -50, 30.22, True]
# print(Mylist)
"# Copy Items in List:"
"# copy method: Will copy list from one to another"
# Mylist = [10, "India", -50, 30.22, True]
# print(CopyMylist)
"# list method:"
# Mylist = [10, "India", -50, 30.22, True]
# CopyMylist = list(Mylist)
# print(CopyMylist)
"# Join Items in List:"
"# Using + Operator:"
# city = ["Lucknow", "Mumbai", "Bangalore"]
# state = ["UP", "Maharastra", "Karnataka"]
# address = city + state
# print(address)
"# append method:"
# city = ["Lucknow", "Mumbai", "Bangalore"]
# state = ["UP", "Maharastra", "Karnataka"]
# for i in state:
# print(city)
"# extend method"
# city = ["Lucknow", "Mumbai", "Bangalore"]
# state = ["UP", "Maharastra", "Karnataka"]
# print(city)
"# sort method: arrange values in ascending order"
# Pincode = [10,20,30, 90, 60, 40, 80, 30]
# print("Asending:", Pincode)
# print("Descending:",Pincode)
"# reverse method"
Pincode = [10,20,30, 90, 60, 40, 80, 30]
print(Pincode)
"# Python Tuples:"
See the next video...