SlideShare a Scribd company logo
PYTHON BUILT IN FUNCTIONS
Abs()-Returns the absolute value of a number
For Example, x = abs(-7.25)
All()-Returns True if all items in an iterable object are
true
For Example, mylist = [True, True, True]
x = all(mylist)
Bin()-Returns the binary version of a number
For Example, x = bin(36)
Bool()-Returns the boolean value of the specified
object
For Example, x = bool(1)
Compile()-Returns the specified source as an
object, ready to be executed
For Example, mytext = 'print(55)'
x = compile('mytext', 'test', 'eval')
exec(x)
Complex()-Returns a complex number
For Example, x = complex(3, 5)
Dict()-Returns a dictionary
For Example, x = dict(name = "John",
age = 36, country = "Norway")
Dir()- Returns a list of the specified object's
properties and methods
For Example, class Person:
name = "John"
age = 36
country = "Norway"
print(dir(Person))
Eval()-Evaluates and executes an expression
For Example, x = 'print(55)‘
eval(x)
Exec()-Executes the specified code (or object)
For Example, x = 'name
="John"nprint(name)'
exec(x)
Filter()-Use a filter function to exclude items in a
iterable object
For Example,
ages = [5, 12, 17, 18, 24, 32]
def myFunc(x):
if x < 18:
return False
else:
return True
adults = filter(myFunc, ages)
for x in adults:
print(x)
Float()- Returns a floating point number
For Example, x = float(3)
Format()-Formats a specified value
For Example, x = format(0.5, '%')
Forzenset()-Returns a frozenset object
For Example, mylist =
['apple', 'banana', 'cherry']
x = frozenset(mylist)
Getattr()-Returns the value of the specified
attribute (property or method)
For Example, class Person:
name = "John"
age = 36
country = "Norway"
x = getattr(Person, 'age')
Globals-Returns the current global symbol table
as a dictionary
For Example, x = globals()
print(x)
Hash()-Returns the hash value of a specified object
Hex()-Converts a number into a hexadecimal value
For Example, x = hex(255)
Id()-Returns the id of an object
For Example, x = ('apple', 'banana', 'cherry')
y = id(x)
Input()-Allowing user input
For Example, print('Enter your name:')
x = input()
print('Hello, ' + x)
Len() – Returns the length of an object
For Example, mylist =
["apple", "banana", "cherry"]
x = len(mylist)
List()-Returns a list
For Example, x
= list(('apple', 'banana', 'cherry'))
Locals()- Returns an updated dictionary of the
current local symbol table
For Example, x = locals()
print(x)
Map()-Returns the specified iterator with the
specified function applied to each item
For Example, def myfunc(n):
return len(n)
x = map(myfunc, ('apple', 'banana', 'cherry'))
Max()-Returns the largest item in an iterable
For Example, x = max(5, 10)
Min()-Returns the smallest item in an iterable
For Example, a = (1, 5, 3, 9)
x = min(a)
Ord()-Convert an integer representing the Unicode
of the specified character
For Example, x = ord("h")
Pow()-Returns the value of x to the power of y
For Example, x = pow(4, 3)
Print()-Prints to the standard output device
For Example, print("Hello World")
Range()-Returns a sequence of numbers, starting
from 0 and increments by 1 (by default)
For Example, x = range(6)
for n in x:
print(n)
Set()-Returns a new set object
For Example, x
= set(('apple', 'banana', 'cherry'))
Sort()-Returns a sorted list
For Example, a =
("a", "b", "c", "d", "e", "f", "g", "h")
x = slice(2)
print(a[x])
Tuple()-Returns a tuple
For Example, x
= tuple(('apple', 'banana', 'cherry'))
GREENS TECHNOLOGYS
Greens Technology is a leading Training and
Placements company in Chennai. We are
known for our practical approach towards
trainings that enable students to gain real-
time exposure on competitive technologies.
Trainings are offered by employees from
MNCs to give a real corporate exposure.

More Related Content

What's hot

Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)
PyData
 
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
Maulik Borsaniya
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptx
AkshayAggarwal79
 
List in Python
List in PythonList in Python
List in Python
Siddique Ibrahim
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
Mohammed Sikander
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
moazamali28
 
Operators in python
Operators in pythonOperators in python
Operators in python
Prabhakaran V M
 
Python list
Python listPython list
Python list
Mohammed Sikander
 
Introduction to matplotlib
Introduction to matplotlibIntroduction to matplotlib
Introduction to matplotlib
Piyush rai
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandas
Piyush rai
 
6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx
Venkateswara Babu Ravipati
 
Strings in C
Strings in CStrings in C
Strings in C
Kamal Acharya
 
Python Modules
Python ModulesPython Modules
Python Modules
Nitin Reddy Katkam
 
Loops in R
Loops in RLoops in R
Loops in R
Chris Orwa
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
nitamhaske
 
USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHON
vikram mahendra
 
C++ Files and Streams
C++ Files and Streams C++ Files and Streams
C++ Files and Streams
Ahmed Farag
 
Datastructures in python
Datastructures in pythonDatastructures in python
Datastructures in python
hydpy
 

What's hot (20)

Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)Introduction to NumPy (PyData SV 2013)
Introduction to NumPy (PyData SV 2013)
 
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptx
 
List in Python
List in PythonList in Python
List in Python
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Python list
Python listPython list
Python list
 
Introduction to matplotlib
Introduction to matplotlibIntroduction to matplotlib
Introduction to matplotlib
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
Introduction to pandas
Introduction to pandasIntroduction to pandas
Introduction to pandas
 
6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx
 
Strings in C
Strings in CStrings in C
Strings in C
 
Python Modules
Python ModulesPython Modules
Python Modules
 
Loops in R
Loops in RLoops in R
Loops in R
 
List,tuple,dictionary
List,tuple,dictionaryList,tuple,dictionary
List,tuple,dictionary
 
USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHON
 
C++ Files and Streams
C++ Files and Streams C++ Files and Streams
C++ Files and Streams
 
Datastructures in python
Datastructures in pythonDatastructures in python
Datastructures in python
 

Similar to Python built in functions

7 Habits For a More Functional Swift
7 Habits For a More Functional Swift7 Habits For a More Functional Swift
7 Habits For a More Functional Swift
Jason Larsen
 
(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to Monads(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to Monads
Lawrence Evans
 
Scala - den smarta kusinen
Scala - den smarta kusinenScala - den smarta kusinen
Scala - den smarta kusinenRedpill Linpro
 
beginners_python_cheat_sheet_pcc_all (3).pptx
beginners_python_cheat_sheet_pcc_all (3).pptxbeginners_python_cheat_sheet_pcc_all (3).pptx
beginners_python_cheat_sheet_pcc_all (3).pptx
HongAnhNguyn285885
 
The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210
Mahmoud Samir Fayed
 
Typelevel summit
Typelevel summitTypelevel summit
Typelevel summit
Marina Sigaeva
 
dictionary14 ppt FINAL.pptx
dictionary14 ppt FINAL.pptxdictionary14 ppt FINAL.pptx
dictionary14 ppt FINAL.pptx
MamtaKaundal1
 
The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202
Mahmoud Samir Fayed
 
R Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdfR Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdf
Timothy McBush Hiele
 
An Introduction to Functional Programming using Haskell
An Introduction to Functional Programming using HaskellAn Introduction to Functional Programming using Haskell
An Introduction to Functional Programming using Haskell
Michel Rijnders
 
The Ring programming language version 1.5.4 book - Part 34 of 185
The Ring programming language version 1.5.4 book - Part 34 of 185The Ring programming language version 1.5.4 book - Part 34 of 185
The Ring programming language version 1.5.4 book - Part 34 of 185
Mahmoud Samir Fayed
 
Monadologie
MonadologieMonadologie
Monadologie
league
 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
InfluxData
 
The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189
Mahmoud Samir Fayed
 
Map, Reduce and Filter in Swift
Map, Reduce and Filter in SwiftMap, Reduce and Filter in Swift
Map, Reduce and Filter in Swift
Aleksandras Smirnovas
 
Revision Tour 1 and 2 complete.doc
Revision Tour 1 and 2 complete.docRevision Tour 1 and 2 complete.doc
Revision Tour 1 and 2 complete.doc
SrikrishnaVundavalli
 
Basic Calculus in R.
Basic Calculus in R. Basic Calculus in R.
Basic Calculus in R.
Dr. Volkan OBAN
 
Array
ArrayArray
Type classes 101 - classification beyond inheritance
Type classes 101 - classification beyond inheritanceType classes 101 - classification beyond inheritance
Type classes 101 - classification beyond inheritance
Alexey Raga
 

Similar to Python built in functions (20)

purrr.pdf
purrr.pdfpurrr.pdf
purrr.pdf
 
7 Habits For a More Functional Swift
7 Habits For a More Functional Swift7 Habits For a More Functional Swift
7 Habits For a More Functional Swift
 
(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to Monads(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to Monads
 
Scala - den smarta kusinen
Scala - den smarta kusinenScala - den smarta kusinen
Scala - den smarta kusinen
 
beginners_python_cheat_sheet_pcc_all (3).pptx
beginners_python_cheat_sheet_pcc_all (3).pptxbeginners_python_cheat_sheet_pcc_all (3).pptx
beginners_python_cheat_sheet_pcc_all (3).pptx
 
The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210The Ring programming language version 1.9 book - Part 31 of 210
The Ring programming language version 1.9 book - Part 31 of 210
 
Typelevel summit
Typelevel summitTypelevel summit
Typelevel summit
 
dictionary14 ppt FINAL.pptx
dictionary14 ppt FINAL.pptxdictionary14 ppt FINAL.pptx
dictionary14 ppt FINAL.pptx
 
The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202The Ring programming language version 1.8 book - Part 29 of 202
The Ring programming language version 1.8 book - Part 29 of 202
 
R Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdfR Cheat Sheet for Data Analysts and Statisticians.pdf
R Cheat Sheet for Data Analysts and Statisticians.pdf
 
An Introduction to Functional Programming using Haskell
An Introduction to Functional Programming using HaskellAn Introduction to Functional Programming using Haskell
An Introduction to Functional Programming using Haskell
 
The Ring programming language version 1.5.4 book - Part 34 of 185
The Ring programming language version 1.5.4 book - Part 34 of 185The Ring programming language version 1.5.4 book - Part 34 of 185
The Ring programming language version 1.5.4 book - Part 34 of 185
 
Monadologie
MonadologieMonadologie
Monadologie
 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
 
The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189The Ring programming language version 1.6 book - Part 26 of 189
The Ring programming language version 1.6 book - Part 26 of 189
 
Map, Reduce and Filter in Swift
Map, Reduce and Filter in SwiftMap, Reduce and Filter in Swift
Map, Reduce and Filter in Swift
 
Revision Tour 1 and 2 complete.doc
Revision Tour 1 and 2 complete.docRevision Tour 1 and 2 complete.doc
Revision Tour 1 and 2 complete.doc
 
Basic Calculus in R.
Basic Calculus in R. Basic Calculus in R.
Basic Calculus in R.
 
Array
ArrayArray
Array
 
Type classes 101 - classification beyond inheritance
Type classes 101 - classification beyond inheritanceType classes 101 - classification beyond inheritance
Type classes 101 - classification beyond inheritance
 

Recently uploaded

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 

Recently uploaded (20)

Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 

Python built in functions

  • 1. PYTHON BUILT IN FUNCTIONS Abs()-Returns the absolute value of a number For Example, x = abs(-7.25) All()-Returns True if all items in an iterable object are true For Example, mylist = [True, True, True] x = all(mylist) Bin()-Returns the binary version of a number For Example, x = bin(36) Bool()-Returns the boolean value of the specified object For Example, x = bool(1)
  • 2. Compile()-Returns the specified source as an object, ready to be executed For Example, mytext = 'print(55)' x = compile('mytext', 'test', 'eval') exec(x) Complex()-Returns a complex number For Example, x = complex(3, 5) Dict()-Returns a dictionary For Example, x = dict(name = "John", age = 36, country = "Norway")
  • 3. Dir()- Returns a list of the specified object's properties and methods For Example, class Person: name = "John" age = 36 country = "Norway" print(dir(Person)) Eval()-Evaluates and executes an expression For Example, x = 'print(55)‘ eval(x)
  • 4. Exec()-Executes the specified code (or object) For Example, x = 'name ="John"nprint(name)' exec(x) Filter()-Use a filter function to exclude items in a iterable object For Example, ages = [5, 12, 17, 18, 24, 32] def myFunc(x): if x < 18: return False else: return True
  • 5. adults = filter(myFunc, ages) for x in adults: print(x) Float()- Returns a floating point number For Example, x = float(3) Format()-Formats a specified value For Example, x = format(0.5, '%') Forzenset()-Returns a frozenset object For Example, mylist = ['apple', 'banana', 'cherry'] x = frozenset(mylist)
  • 6. Getattr()-Returns the value of the specified attribute (property or method) For Example, class Person: name = "John" age = 36 country = "Norway" x = getattr(Person, 'age') Globals-Returns the current global symbol table as a dictionary For Example, x = globals() print(x)
  • 7. Hash()-Returns the hash value of a specified object Hex()-Converts a number into a hexadecimal value For Example, x = hex(255) Id()-Returns the id of an object For Example, x = ('apple', 'banana', 'cherry') y = id(x) Input()-Allowing user input For Example, print('Enter your name:') x = input() print('Hello, ' + x)
  • 8. Len() – Returns the length of an object For Example, mylist = ["apple", "banana", "cherry"] x = len(mylist) List()-Returns a list For Example, x = list(('apple', 'banana', 'cherry')) Locals()- Returns an updated dictionary of the current local symbol table For Example, x = locals() print(x)
  • 9. Map()-Returns the specified iterator with the specified function applied to each item For Example, def myfunc(n): return len(n) x = map(myfunc, ('apple', 'banana', 'cherry')) Max()-Returns the largest item in an iterable For Example, x = max(5, 10) Min()-Returns the smallest item in an iterable For Example, a = (1, 5, 3, 9) x = min(a)
  • 10. Ord()-Convert an integer representing the Unicode of the specified character For Example, x = ord("h") Pow()-Returns the value of x to the power of y For Example, x = pow(4, 3) Print()-Prints to the standard output device For Example, print("Hello World") Range()-Returns a sequence of numbers, starting from 0 and increments by 1 (by default) For Example, x = range(6) for n in x: print(n)
  • 11. Set()-Returns a new set object For Example, x = set(('apple', 'banana', 'cherry')) Sort()-Returns a sorted list For Example, a = ("a", "b", "c", "d", "e", "f", "g", "h") x = slice(2) print(a[x]) Tuple()-Returns a tuple For Example, x = tuple(('apple', 'banana', 'cherry'))
  • 12. GREENS TECHNOLOGYS Greens Technology is a leading Training and Placements company in Chennai. We are known for our practical approach towards trainings that enable students to gain real- time exposure on competitive technologies. Trainings are offered by employees from MNCs to give a real corporate exposure.