0% found this document useful (0 votes)
51 views4 pages

DATATYPES

This document contains summaries of functions related to lists, tuples, and sets in Python. For lists, it provides descriptions of various list methods like append(), pop(), sort(), etc. It also describes functions for basic operations on lists like length, minimum/maximum values, indexing, etc. For tuples, it only lists the id() function. For sets, it indicates that sets print unordered elements and are mutable, while frozen sets are immutable.

Uploaded by

vaishnavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views4 pages

DATATYPES

This document contains summaries of functions related to lists, tuples, and sets in Python. For lists, it provides descriptions of various list methods like append(), pop(), sort(), etc. It also describes functions for basic operations on lists like length, minimum/maximum values, indexing, etc. For tuples, it only lists the id() function. For sets, it indicates that sets print unordered elements and are mutable, while frozen sets are immutable.

Uploaded by

vaishnavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 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