@farazEskandari/

Lists, Tuples, Sets

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
my_list = [21, 34, 45, 54, 90]
my_tuple = (32, 36, 36, 65, 98)
my_set = {65, 98, 63, 65, 32}

print(my_list)
print(my_tuple)
print(my_set) #set ignore all duplicates from its lists

my_list.append(75) #has append to add number in the end of list
my_tuple = my_tuple + (63 ,) #has no append but plus sign can add end of tuple if use , sign after data type
my_set.add(163) #has add for adding number in end of set

print(my_list)
print(my_tuple)
print(my_set)

print(my_list[2])
print(my_tuple[2])