#python
Автор: LearnCode005
Загружено: 2026-03-08
Просмотров: 85
Описание:
#python live telugu #Learncode005 codeing channel, learning codeing easy
https://www.w3schools.com/python/pyth...
thislist = ["apple", "banana", "cherry"]#packing
print(thislist) #print the collection ,is list
thislist = ["apple", "banana", "cherry"] #index 0 it started
print(thislist[1])
print(thislist[2])
print("----------example of -1")
thislist = ["apple", "banana", "cherry"]
print(thislist[-1])
print(thislist[-2])
print(thislist[-3])
print("example of range start and end")
thislist = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"]
print(thislist[2:5])
print(thislist[5:7])
#This example returns the items from the beginning to, but NOT including, "kiwi":
thislist = ["apple", "banana", "cherry", "orange", "kiwi", "melon", "mango"]
print(thislist[:4])
#changing the list item example
thislist = ["apple", "banana", "cherry","Kiwi"]
thislist[1] = "blackcurrant"
print(thislist)
thislist.append("banana")
print(thislist)
thislist.remove("banana")
print(thislist)
thislistFruits = ["apple", "banana", "cherry","Kiwi"]
for x in thislistFruits:
if x == "Kiwi":
print('index is ', thislistFruits.index(x), x)
fruits = ["apple", "banana", "cherry", "kiwi", "mango"]
newlist = []
for x in fruits:
if "a" in x:
newlist.append(x)
print(newlist)
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: