Python Standard Library
- When we install python, python ships with lots of code
- Most of them are created for reusing
- This is also referred as batteries included.
- Most common usable elements (functions/classes) are referred as builtins
- Prompt
You are an expert in python, i'm learning python.
I want to understand what builtins are and give me a list of builtin in a table with its purpose and an example usage
Module
- A module in python refers to a file
- If i have created a python file
test.pythen it is module with nametest - Python standard library is collection of modules.
Lets create a simple module
- A module can act as a library or as an executable
- executable => run program
- library => reusable elements
- Refer Here for using a module with imports
In python we have some special variables or methods – dunder methods
- Anything which you see in python with
__double underscores around it , it has a special purpose. - Prompt
You are an expert in python, i'm learning python.
I want to understand what dunder variables are and give me a list of dunder variables in a table with its purpose and an example usage
-
Exercise:
- I want to ask user to enter some value what builtin function can be used
- I have a variable which is string has a value
'10', i want to convert that into int which builtin function can help me - Change the prime number python ocde to ask the value from user
