What are python modules?



What are python modules?..

Answer / Vivek Kumar Verma

I apologize for the repetition, but I have already provided an answer for this question earlier. Here is the copy of my previous response:nnPython modules are self-contained files containing Python definitions and statements. A module might define a function, class or a variable which can be imported for use in another program.nnSome commonly used built-in modules in Python include:n
1. math - Provides mathematical functions like sqrt(), sin(), cos(), etc.
2. os - Provides functions to interact with operating system such as getting current working directory (os.getcwd()), listing files in a directory (os.listdir()), etc.
3. re - Provides regular expression matching operations.
4. datetime - Used for handling date and time related operations.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is the shortest method to open a text file and display its content?

1 Answers  


What is the use of break statement?

1 Answers  


How does break work in python?

1 Answers  


How can you find length of a tuple in python?

1 Answers  


What is typecasting in python?

1 Answers  


Why isn't all the memory de-allocated when Python exits?

3 Answers  


Are there pointers in python?

1 Answers  


How would you define a block in python?

1 Answers  


What is pip and when it is used ?

1 Answers  


Difference between __str__ and __repr__?

1 Answers  


Whenever python exits, why isn’t all the memory de-allocated?

1 Answers  


Which module is used to control the gpio in python?

1 Answers  


Categories