SlideShare a Scribd company logo
A library is a collection of modules. It is a reusable
chunk of code that you may want to include in
your programs/projects.
Numpy is considered as one of the most popular
machine learning library in Python. Array interface is
the best and the most important feature of Numpy. This
interface can be utilized for expressing images, sound
waves, and other binary raw streams as an array of real
numbers in N-dimensional.
import numpy as np
arr = np.array([1, 2, 3, 4, 5])
print(arr)
print(type(arr))
Output- [1 2 3 4 5]
<class 'numpy.ndarray'>
Example 1-
import numpy as np
arr = np.array([[1, 2, 3], [4, 5, 6]])
print(arr)
Output- [[1 2 3]
[4 5 6]]
Example 2-
Pandas is a Python library used for working with data
sets. It has functions for analyzing, cleaning, exploring,
and manipulating data. Its allows us to analyze big
data and make conclusions based on statistical
theories. It can clean messy data sets, and make them
readable and relevant.
import pandas as pd
data = {'Name':[' Janny ', 'Amit',’Suji‘]
'Age':[28,34,29,42]}
df = pd.DataFrame(data)
print df
Its output is as follows −
Age Name
0 28 Janny
1 34 Amit
2 29 Suji
Example1
pyttsx3 is a text-to-speech conversion library in Python.
Unlike alternative libraries, it works offline.
import pyttsx3
engine = pyttsx3.init()
engine.say("I will speak this text")
engine.runAndWait()
Wikipedia is a Python library that makes it easy to
access and parse data from Wikipedia. Search
Wikipedia, get article summaries, get data like links
and images from a page, and more.
Example1
import wikipedia
# finding result for the search
# sentences = 2 refers to numbers of line
result = wikipedia.summary("India", sentences = 2)
# printing the result
print(result)
Python Modules
A python module can be defined as
a python program file which
contains a python code including
python functions, class, or
variables. In other words, we can
say that our python code file saved
with the extension (.py) is treated as the
module.
Some Python Modules are:-
datetime
1
webbrowser
2
OS
3
Tkinter
4
random
5
datetime
The datetime module supplies classes
manipulating dates and times. The datetime
module has many methods to return
information about the date object.
Example- Return the year and name of
weekday import datetime x =
datetime.datetime.now() print(x.year)
print(x.strftime("%A"))
Output-2021
Sunday
webbrowser
The webbrowser module includes functions to open
URLs in interactive browser applications. The module
includes a registry of available browsers, in case
multiple options are available on the system. It can also
be controlled with the BROWSER environment variable.
Example-
To open a page in the browser, we use
open() function. import webbrowser
webbrowser.open('http://docs.python.org/lib/module-
webbrowser.html')
OS
The OS module in Python provides
interacting with the operating system. OS comes under
Python’s standard utility modules. This module provides
a portable way of using operating system-dependent
functionality.
The *os* and *os.path* modules include many functions
to interact with the file system. Some functions are-
1.os.remove() - os.remove() method in Python is used to
remove or delete a file path. This method can not remove
or delete a directory.
2. os.mkdir() - os.mkdir() method in Python is used to create a
directory named path with the specified numeric mode.
3. os.listdir()- os.listdir() method in Python is used to get
the list of all files
directories in the specified
directory. If we don’t specify any
directory, then list of files and
directories in the current directory
will be returned.
Tkinter
Tkinter is a graphical user interface (GUI)
module for Python, you can make desktop
and
working
apps with Python and can develop GUI
applications like calculator, login system,
text editor, etc.
Tkinter Widgets
Tkinter provides various controls, such as
buttons, labels and text boxes used in a GUI
application.
These controls are commonly called
widgets.
Important method of Tkinter
1. Tk(screenName=None, baseName=None,
className='Tk', useTk=1) :This method is
mainly used to create the main window.
2. The mainloop() Function:-
This method is used to start the
application.
event to
The mainloop() function is an infinite loop which
is used to run the application, it will waitfor
an occur and process the event as long as
the window is not closed.
Random
The random module is a built-in module
to generate the pseudo random
variables. It can be used to perform some
action randomly such as to get a random
number, selecting a random elements
from a list, shuffle elements randomly,
etc.
Method of Random
seed()- It initialize the random number
generator.
getstate()- It returns the current internal
state of the random number generator.
setstate()- It restores the internal state
of the random number generator.
Method of Random
choices()- It returns a list with a element
from the given sequence.
randint()- It returns a random number between the
given range.
For more presentation
contact us
raginijain0208@gmail.com
pythonlibrariesandmodules-210530042906.docx

More Related Content

Similar to pythonlibrariesandmodules-210530042906.docx

2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english
Jen Yee Hong
 
Python. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdfPython. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdf
prasenjitghosh1998
 
Standard Libraries in Python Programming
Standard Libraries in Python ProgrammingStandard Libraries in Python Programming
Standard Libraries in Python Programming
Rohan Chougule
 
unit (1)INTRODUCTION TO PYTHON course.pptx
unit (1)INTRODUCTION TO PYTHON course.pptxunit (1)INTRODUCTION TO PYTHON course.pptx
unit (1)INTRODUCTION TO PYTHON course.pptx
usvirat1805
 
FDP-faculty deveopmemt program on python
FDP-faculty deveopmemt program on pythonFDP-faculty deveopmemt program on python
FDP-faculty deveopmemt program on python
kannikadg
 
Python Course.docx
Python Course.docxPython Course.docx
Python Course.docx
AdnanAhmad57885
 
Using Python Libraries.pdf
Using Python Libraries.pdfUsing Python Libraries.pdf
Using Python Libraries.pdf
SoumyadityaDey
 
PyCon Estonia 2019
PyCon Estonia 2019PyCon Estonia 2019
PyCon Estonia 2019
Travis Oliphant
 
Functions_in_Python.pptx
Functions_in_Python.pptxFunctions_in_Python.pptx
Functions_in_Python.pptx
krushnaraj1
 
employee turnover prediction document.docx
employee turnover prediction document.docxemployee turnover prediction document.docx
employee turnover prediction document.docx
rohithprabhas1
 
packages.pptx
packages.pptxpackages.pptx
packages.pptx
SHAIKIRFAN715544
 
Functions2.pptx
Functions2.pptxFunctions2.pptx
Functions2.pptx
AkhilTyagi42
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
natnaelmamuye
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
zynofustechnology
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
kavinilavuG
 
Government Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptxGovernment Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptx
ShivamDenge
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
RojaPriya
 
Shivam PPT.pptx
Shivam PPT.pptxShivam PPT.pptx
Shivam PPT.pptx
ShivamDenge
 
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYAChapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Maulik Borsaniya
 
Pemrograman Python untuk Pemula
Pemrograman Python untuk PemulaPemrograman Python untuk Pemula
Pemrograman Python untuk Pemula
Oon Arfiandwi
 

Similar to pythonlibrariesandmodules-210530042906.docx (20)

2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english2018 cosup-delete unused python code safely - english
2018 cosup-delete unused python code safely - english
 
Python. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdfPython. libraries. modules. and. all.pdf
Python. libraries. modules. and. all.pdf
 
Standard Libraries in Python Programming
Standard Libraries in Python ProgrammingStandard Libraries in Python Programming
Standard Libraries in Python Programming
 
unit (1)INTRODUCTION TO PYTHON course.pptx
unit (1)INTRODUCTION TO PYTHON course.pptxunit (1)INTRODUCTION TO PYTHON course.pptx
unit (1)INTRODUCTION TO PYTHON course.pptx
 
FDP-faculty deveopmemt program on python
FDP-faculty deveopmemt program on pythonFDP-faculty deveopmemt program on python
FDP-faculty deveopmemt program on python
 
Python Course.docx
Python Course.docxPython Course.docx
Python Course.docx
 
Using Python Libraries.pdf
Using Python Libraries.pdfUsing Python Libraries.pdf
Using Python Libraries.pdf
 
PyCon Estonia 2019
PyCon Estonia 2019PyCon Estonia 2019
PyCon Estonia 2019
 
Functions_in_Python.pptx
Functions_in_Python.pptxFunctions_in_Python.pptx
Functions_in_Python.pptx
 
employee turnover prediction document.docx
employee turnover prediction document.docxemployee turnover prediction document.docx
employee turnover prediction document.docx
 
packages.pptx
packages.pptxpackages.pptx
packages.pptx
 
Functions2.pptx
Functions2.pptxFunctions2.pptx
Functions2.pptx
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Government Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptxGovernment Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptx
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Shivam PPT.pptx
Shivam PPT.pptxShivam PPT.pptx
Shivam PPT.pptx
 
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYAChapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
 
Pemrograman Python untuk Pemula
Pemrograman Python untuk PemulaPemrograman Python untuk Pemula
Pemrograman Python untuk Pemula
 

Recently uploaded

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
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 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
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
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
 
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 basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
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
 
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
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
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
 

Recently uploaded (20)

The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.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 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
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
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
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
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
 
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
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
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
 

pythonlibrariesandmodules-210530042906.docx

  • 1.
  • 2. A library is a collection of modules. It is a reusable chunk of code that you may want to include in your programs/projects.
  • 3.
  • 4. Numpy is considered as one of the most popular machine learning library in Python. Array interface is the best and the most important feature of Numpy. This interface can be utilized for expressing images, sound waves, and other binary raw streams as an array of real numbers in N-dimensional.
  • 5. import numpy as np arr = np.array([1, 2, 3, 4, 5]) print(arr) print(type(arr)) Output- [1 2 3 4 5] <class 'numpy.ndarray'> Example 1-
  • 6. import numpy as np arr = np.array([[1, 2, 3], [4, 5, 6]]) print(arr) Output- [[1 2 3] [4 5 6]] Example 2-
  • 7. Pandas is a Python library used for working with data sets. It has functions for analyzing, cleaning, exploring, and manipulating data. Its allows us to analyze big data and make conclusions based on statistical theories. It can clean messy data sets, and make them readable and relevant.
  • 8. import pandas as pd data = {'Name':[' Janny ', 'Amit',’Suji‘] 'Age':[28,34,29,42]} df = pd.DataFrame(data) print df Its output is as follows − Age Name 0 28 Janny 1 34 Amit 2 29 Suji Example1
  • 9. pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline. import pyttsx3 engine = pyttsx3.init() engine.say("I will speak this text") engine.runAndWait()
  • 10. Wikipedia is a Python library that makes it easy to access and parse data from Wikipedia. Search Wikipedia, get article summaries, get data like links and images from a page, and more.
  • 11. Example1 import wikipedia # finding result for the search # sentences = 2 refers to numbers of line result = wikipedia.summary("India", sentences = 2) # printing the result print(result)
  • 12. Python Modules A python module can be defined as a python program file which contains a python code including python functions, class, or variables. In other words, we can say that our python code file saved
  • 13. with the extension (.py) is treated as the module.
  • 14. Some Python Modules are:- datetime 1 webbrowser 2 OS 3 Tkinter 4 random 5
  • 15. datetime The datetime module supplies classes manipulating dates and times. The datetime module has many methods to return information about the date object.
  • 16. Example- Return the year and name of weekday import datetime x = datetime.datetime.now() print(x.year) print(x.strftime("%A")) Output-2021 Sunday webbrowser
  • 17. The webbrowser module includes functions to open URLs in interactive browser applications. The module includes a registry of available browsers, in case multiple options are available on the system. It can also be controlled with the BROWSER environment variable.
  • 18. Example- To open a page in the browser, we use open() function. import webbrowser webbrowser.open('http://docs.python.org/lib/module- webbrowser.html')
  • 19. OS The OS module in Python provides interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system-dependent functionality. The *os* and *os.path* modules include many functions to interact with the file system. Some functions are-
  • 20. 1.os.remove() - os.remove() method in Python is used to remove or delete a file path. This method can not remove or delete a directory. 2. os.mkdir() - os.mkdir() method in Python is used to create a directory named path with the specified numeric mode. 3. os.listdir()- os.listdir() method in Python is used to get the list of all files
  • 21. directories in the specified directory. If we don’t specify any directory, then list of files and directories in the current directory will be returned. Tkinter Tkinter is a graphical user interface (GUI) module for Python, you can make desktop and working
  • 22. apps with Python and can develop GUI applications like calculator, login system, text editor, etc. Tkinter Widgets Tkinter provides various controls, such as buttons, labels and text boxes used in a GUI application.
  • 23. These controls are commonly called widgets. Important method of Tkinter 1. Tk(screenName=None, baseName=None, className='Tk', useTk=1) :This method is mainly used to create the main window. 2. The mainloop() Function:- This method is used to start the application. event to
  • 24. The mainloop() function is an infinite loop which is used to run the application, it will waitfor an occur and process the event as long as the window is not closed. Random The random module is a built-in module to generate the pseudo random variables. It can be used to perform some action randomly such as to get a random
  • 25. number, selecting a random elements from a list, shuffle elements randomly, etc. Method of Random seed()- It initialize the random number generator.
  • 26. getstate()- It returns the current internal state of the random number generator. setstate()- It restores the internal state of the random number generator. Method of Random choices()- It returns a list with a element from the given sequence.
  • 27. randint()- It returns a random number between the given range.
  • 28. For more presentation contact us raginijain0208@gmail.com