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
Please check our video tutorial on 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.
This wraps up our session on python program to find natural log or python program to find log of a number.
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 & Blockchain Enthusiast
Page Views :
Published Date :
Nov 13,2022