Free Python Course
الذهاب إلى القناة على Telegram
إظهار المزيد
5 967
المشتركون
لا توجد بيانات24 ساعات
-357 أيام
-22530 أيام
أرشيف المشاركات
5 967
LIST CLEAR
data = ["Code" , "With" , "Rushi", 23]
data.clear()
print(data)
Output :
[ ]5 967
LIST APPEND
data = ["Code" , "With" , "Rushi", 23]
data.append(9)
data.append("CodeWithRushi.com")
print(data)
Output :
['Code', 'With', 'Rushi', 23, 9, 'CodeWithRushi.com']5 967
EXAMPLE 4
data = ["Code" , "With" , "Rushi" , 23]
print(data[0:2])
Output :
['Code','With']5 967
EXAMPLE 3 : LIST SLICING AND INDEXING
data = ["Code" , "With" , "Shani" , 23]
print(data[1])
Output :
Code5 967
EXAMPLE 2
data = ["Free" , "Python" , "Course" , 23]
for i in data:
print(i)
Output :
Free
Python
Course
235 967
WHAT IS LIST ?
Lists are used to store multiple items in a single variable.
Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage.
Lists are created using square brackets:
5 967
MEMBERSHIP OPERATOR :
Membership operators are used to test if a sequence is presented in an object:
5 967
IDENTITY OPERATOR :
Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location:
5 967
LOGICAL OPERATOR :
Logical operators are used to combine conditional statements:
5 967
ASSIGNMENT OPERATORS : Assignment operators are used to assign values to variables:
