You are on page 1of 4

SNO KEYWORDS FUNCTIONS

1 types()
2 listlen()
3 list :3
4 list ::-1
5 append alist.append()
6 remove alist.remove()
7 alist.pop()
8 alist.pop(0)
9 insert alist.insert(0,any variable)
10 extend alist*2
11 extend alist+blist
12 reverse alist.reverse()
13 alist.sort()
print(alist)
print(sorted(string, key=len))
sort
print(len(alist))
print(min(alist))
print(max(alist))
14 sort alist.sort(reverse=true)
15 sorted_list sorted_list = sorted(alist)
16 count alist.count(eg:'abc')
17 index alist.index('')
18 concatenate new_list = alist + blist

Tuples
SNO KEYWORDS DECRIPTION
1 id(tup1) displays the id(like harddisk(memory))

SETS
SNO KEYWORDS DECRIPTION
1 print(normal_set) prints the elements & mutable
2 print(frozen_set) prints unordered & immutable
3 frozen_set(add/delete) not possible
DECRIPTION
it returns the data types of the variable
length of the variables
it returns upto 3 index values
it returns values from right end
add new element to the existing list
removes element from the existing list
pop out the last element from the list
pop out the 'index 0' element from the list
inserting elements at '0'th index position
extending 2 list one after another
concatenating two list
printing the result in reverse order
sorting in ascending order
prints in ascending order
print the sorted elements based on the length of the string
prints the length of the list
prints min value in the value
prints max value in the value
sorting in descending order
sorting in ascending order
count the elements in the list.eg:if we give any specific element in the list it displays how many times its present in the list
it display the index value of that variable
concatenating two list
DATATYPES SUBTYPES ENCLOSED BY
int
Numbers float
complex
1
bool
0
sets ([])
dictionaries/mapping {}
string a',"a","""a"""
sequence list []
tuple ()
ORDERED/UNORDERED MUTABLE/IMMUTABLE

unordered muttable(frozen sets are immutable)


unordered keys immutable &values are mutables
immutable
ordered(stored in memory) mutable
immutable

You might also like