in

# Python Built-in Functions, Libraries, and modules – Day 10

In this article you will learn Python Built-in functions, libraries and modules.

Python has many inbuilt modules and packages. Today we sill discuss them all.

Want to learn python from scratch – Day 1 in python begineer to advance

Day

New here?

## 1.Random Library function in python

Random library in python is very useful. This module helps in generating random numbers.

The code given below generates a random number between x and y-1 (both inclusive) using the randrange function of the random module.

``````import random

x=10

y=50

print(random.randrange(x,y)) ``````

Output will be different in each run.

## Python math module

math is another useful module in Python. Once you have imported the math module, you can use some of the below functions:

Try the code:

```import math
num1=234.01
num2=6
num3=-27.01
print("The smallest integer greater than or equal to num1,",num1,":",math.ceil(num1))
print("The largest integer smaller than or equal to num1,",num1,":",math.floor(num1))
print("The factorial of num2,",num2,":", math.factorial(num2))
print("The absolute value of num3",num3,":",math.fabs(num3))```

## String Functions in python

String data type in Python has many inbuilt functions which make it easier to work with strings.

`Consider the string, name="Raghav".`

## List Functions in Python

List data type in Python also have many inbuilt functions.

## Dictionary function in python

Dictionary in Python also have many inbuilt functions.

Consider a dictionary:

``````crew_details={
"Pilot":"Kumar",
"Co-pilot":"Raghav",
"Stewardess":"Mala"
}``````

## Python Date and Time module

Python has inbuilt modules called time and datetime. They are very helpful in finding details of time.

New here?

comment below with your query, we usually replies within 12 hours.

some examples