Python program to find natural log of a number
In this python program guide, we will learn to write:
-
program to find natural log of a number in python
Program to find Natural log of a number in Python
The python program to find natural log of a number is as follows:
# Owner : TutorialsInhand Author : Devjeet Roy
import math
number = int(input("Enter the number: "))
ans = math.log(number)
print("The value is:",ans)
The output of python program to find log of a number is as follows:
PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py
Enter the number: 5
The value is: 1.6094379124341003
Few important points about this program:
1. To do mathematical operations, we need to import the math library.
2. The math library provides many log formulae, like loge, log10, log2 etc.
3. We find the natural log using the .log() method in the math library.
Would you like to see your article here on tutorialsinhand.
Join
Write4Us program by tutorialsinhand.com
About the Author
Devjeet Roy
Full Stack Web Developer & Data Science Enthusiast
Page Views :
Published Date :
Jan 27,2021