{"id":87063,"date":"2023-03-24T10:41:36","date_gmt":"2023-03-24T05:11:36","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=87063"},"modified":"2023-03-24T10:41:36","modified_gmt":"2023-03-24T05:11:36","slug":"python-math-module-python-for-mathematics","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/","title":{"rendered":"Python Math Module &#8211; Python for Mathematics"},"content":{"rendered":"<p>The majority of Python development involves mathematical calculations. It is impossible to avoid the need for math when working on a scientific project, a financial application, or any other type of programming project that you are undertaking.<\/p>\n<p>Python&#8217;s built-in mathematical operators, such as addition (+), subtraction (-), division (\/), and multiplication (*), can be used for simple mathematical calculations. However, more advanced operations like exponential, logarithmic, trigonometric, or power functions are not included. Does this imply that you must recreate all of these functions?<\/p>\n<p>No, thankfully. Python includes a math module that is specifically designed for higher-level mathematical operations.<\/p>\n<h3>What is the Python math Module?<\/h3>\n<p>The math module in Python provides mathematical functions and constants, including trigonometric functions, logarithmic functions, and other mathematical constants. Some examples of functions provided by the math module include sqrt() for finding the square root of a number, sin() and cos() for trigonometry, and exp() for exponentiation.<\/p>\n<p>Additionally, the math module also provides constants such as pi and e. To use the functions and constants provided by the math module, you need to import it using the import statement.<\/p>\n<p>Example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nx = math.sqrt(16)\nprint(x) # 4.0\n\ny = math.sin(math.pi)\nprint(y) # 1.2246467991473532e-16\n\nz = math.exp(2)\nprint(z) # 7.389056098930649\n<\/pre>\n<p>You can also import specific functions or constants from the math module using the from keyword.<\/p>\n<p>Example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from math import sqrt, pi\n\nx = sqrt(16)\nprint(x) # 4.0\n\ny = pi\nprint(y) # 3.141592653589793\n<\/pre>\n<h3>Constants of python math module<\/h3>\n<p>The math module in Python provides several mathematical constants that can be used in mathematical calculations. Some of these constants include:<\/p>\n<ul>\n<li>math.pi: The mathematical constant pi (\u03c0), which is the ratio of a circle&#8217;s circumference to its diameter.<\/li>\n<li>math.e: The mathematical constant e, which is the base of the natural logarithm.<\/li>\n<li>math.tau: The mathematical constant tau (\u03c4), which is equal to 2*pi.<\/li>\n<li>math.inf: A special floating-point value that represents positive infinity.<\/li>\n<li>math.nan: A special floating-point value that represents &#8220;not a number.&#8221;<\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.pi) # 3.141592653589793\nprint(math.e) # 2.718281828459045\nprint(math.tau) # 6.283185307179586\n<\/pre>\n<p>Note that these are read-only constants and cannot be reassigned, if you try to reassign these constants it will raise a SyntaxError.<\/p>\n<h3>Functions in Python math Module<\/h3>\n<table>\n<tbody>\n<tr>\n<td><strong>Function<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">ceil(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the smallest integer greater than or equal to x.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isinf(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns True if x is a positive or negative infinity<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isnan(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns True if x is a NaN<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">exp(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns e**x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">log10(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the base-10 logarithm of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">log(x[, b])<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the logarithm of x to the base b (defaults to e)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">modf(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the fractional and integer parts of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">isfinite(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns True if x is neither an infinity nor a NaN (Not a Number)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">factorial(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the factorial of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">ldexp(x, i)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns x * (2**i)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">pow(x, y)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns x raised to the power y<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">copysign(x, y)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns x with the sign of y<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">fabs(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the absolute value of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">floor(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the largest integer less than or equal to x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">fmod(x, y)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the remainder when x is divided by y<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">frexp(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the mantissa and exponent of x as the pair (m, e)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">fsum(iterable)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns an accurate floating point sum of values in the iterable<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">trunc(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the truncated integer value of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">expm1(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns e**x &#8211; 1<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">log1p(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the natural logarithm of 1+x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">log2(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the base-2 logarithm of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">sqrt(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the square root of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">acos(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the arc cosine of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">asin(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the arc sine of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">atan(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the arc tangent of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">atan2(y, x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns atan(y \/ x)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">cos(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the cosine of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">hypot(x, y)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the Euclidean norm, sqrt(x*x + y*y)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">sin(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the sine of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">tan(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the tangent of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">degrees(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Converts angle x from radians to degrees<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">radians(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Converts angle x from degrees to radians<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">acosh(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the inverse hyperbolic cosine of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">asinh(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the inverse hyperbolic sine of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">atanh(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the inverse hyperbolic tangent of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">cosh(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the hyperbolic cosine of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">sinh(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the hyperbolic cosine of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">tanh(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the hyperbolic tangent of x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">erf(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the error function at x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">erfc(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the complementary error function at x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">gamma(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the Gamma function at x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">lgamma(x)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Returns the natural logarithm of the absolute value of the Gamma function at x<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">pi<\/span><\/td>\n<td><span style=\"font-weight: 400\">Mathematical constant, the ratio of circumference of a circle to it&#8217;s diameter (3.14159&#8230;)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">e<\/span><\/td>\n<td><span style=\"font-weight: 400\">mathematical constant e (2.71828&#8230;)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Functions available in python\u2019s math module<\/h3>\n<p><strong>1. math.sqrt(x):<\/strong> Returns the square root of x.<\/p>\n<p><strong><strong>Example:<\/strong><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.sqrt(16)) # Output: 4.0\n<\/pre>\n<p><strong><b>2. math.floor(x):<\/b> <\/strong>Returns the largest integer less than or equal to x.<\/p>\n<p><strong><strong>Example:<\/strong><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.floor(3.14)) # Output: 3\n<\/pre>\n<p><b>3. math.ceil(x):<\/b> Returns the smallest integer greater than or equal to x.<br \/>\n<b><b><\/b><\/b><\/p>\n<p><b><b><strong>Example:<\/strong><\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.ceil(3.14)) # Output: 4\n<\/pre>\n<p><b>4. math.exp(x):<\/b> Returns e raised to the power of x.<\/p>\n<p><strong><strong>Example:<\/strong><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.exp(1)) # Output: 2.718281828459045\n<\/pre>\n<p><b>5. math.log(x[, base]): <\/b>Returns the natural logarithm of x, or the logarithm of x to base if specified.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.log(100)) # Output: 4.605170185988092\nprint(math.log(100, 10)) # Output: 2.0\n<\/pre>\n<p><b><b>6. math.log10(x): <span style=\"font-weight: 400\">Returns the base-10 logarithm of x.<\/span><br \/>\n<\/b><\/b><\/p>\n<p><b><b><strong>Example:<\/strong><\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.log10(100)) # Output: 2.0\n<\/pre>\n<p><b><b>7. math.sin(x): <span style=\"font-weight: 400\">Returns the sine of x (measured in radians).<\/span><br \/>\n<\/b><\/b><\/p>\n<p><b><b><strong>Example:<\/strong><\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.sin(math.pi \/ 2)) # Output: 1.0\n<\/pre>\n<p><b><b>8. math.cos(x): <span style=\"font-weight: 400\">Returns the cosine of x (measured in radians).<\/span><br \/>\n<\/b><\/b><\/p>\n<p><b><b><strong>Example:<\/strong><\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.cos(0)) # Output: 1.0\n<\/pre>\n<p><b><b>9. math.tan(x): <span style=\"font-weight: 400\">Returns the tangent of x (measured in radians).<br \/>\n<\/span><\/b><\/b><b><b><\/b><\/b><\/p>\n<p><b><b>Example:<\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.tan(math.pi \/ 4)) # Output: 1.0\n<\/pre>\n<p><b><b>10. math.asin(x): <span style=\"font-weight: 400\">Returns the arcsine of x, in radians.<\/span><br \/>\n<\/b><\/b><\/p>\n<p><b><b>Example:<\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.asin(1)) # Output: 1.5707963267948966\n<\/pre>\n<p><b>11. math.acos(x):<\/b><span style=\"font-weight: 400\"><span style=\"font-weight: 400\">\u00a0Returns the arccosine of x, in radians.<br \/>\n<b><\/b><\/span><\/span><\/p>\n<p><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><b>Example:<\/b><\/span><\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.acos(0)) # Output: 1.5707963267948966\n<\/pre>\n<p><b><b>12. math.atan(x): <span style=\"font-weight: 400\">Returns the arctangent of x, in radians.<br \/>\n<\/span><\/b><\/b><\/p>\n<p><b><b><span style=\"font-weight: 400\"><strong>Example:<\/strong><\/span><\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.atan(1)) # Output: 0.7853981633974483\n<\/pre>\n<p><b>13. math.degrees(x): <\/b><span style=\"font-weight: 400\"><span style=\"font-weight: 400\">Converts angle x from radians to degrees.<br \/>\n<b><\/b><\/span><\/span><\/p>\n<p><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><b><strong>Example:<\/strong><\/b><\/span><\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.degrees(math.pi)) # Output: 180.0\n<\/pre>\n<p><b><b>14. math.radians(x): <span style=\"font-weight: 400\">Converts angle x from degrees to radians.<\/span><br \/>\n<\/b><\/b><\/p>\n<p><b><b><span style=\"font-weight: 400\"><strong>Example:<\/strong><\/span><\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.radians(180)) # Output: 3.141592653589793\n<\/pre>\n<p><b><b>15. math.pi: <span style=\"font-weight: 400\">The mathematical constant pi (3.14159&#8230;).<br \/>\n<\/span><\/b><\/b><b><b><\/b><\/b><\/p>\n<p><b><b>Example:<\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.pi) # Output: 3.141592653589793\n<\/pre>\n<p><b><b>16. math.e: <span style=\"font-weight: 400\">The mathematical constant e (2.71828&#8230;).<br \/>\n<\/span><\/b><\/b><b><b><\/b><\/b><\/p>\n<p><b><b>Example:<\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.e) # Output: 2.718281828459045\n<\/pre>\n<p><b><b>17. math.inf: <span style=\"font-weight: 400\">Positive infinity.<\/span><br \/>\n<\/b><\/b><\/p>\n<p><b><b>Example:<\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.inf) # Output: inf\n<\/pre>\n<p><b><b>18. math.isinf(x): <span style=\"font-weight: 400\">Returns True if x is a positive or negative infinity, False otherwise.<\/span><br \/>\n<\/b><\/b><\/p>\n<p><b><b>Example:<\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.isinf(math.inf)) # Output: True\n<\/pre>\n<p><b>19. math.isnan(x): <\/b><span style=\"font-weight: 400\"><span style=\"font-weight: 400\">Returns True if x is NaN (Not a Number), False otherwise.<br \/>\n<\/span><\/span><b><b><\/b><\/b><\/p>\n<p><b><b>Example:<\/b><\/b><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.isnan(math.sqrt(-1))) # Output: True\n<\/pre>\n<p><b>20. math.copysign(x, y): <\/b><span style=\"font-weight: 400\"><span style=\"font-weight: 400\">Returns a float with the magnitude (absolute value) of x but the sign of y.<br \/>\n<b><\/b><\/span><\/span><\/p>\n<p><span style=\"font-weight: 400\"><span style=\"font-weight: 400\"><b>Example:<\/b><\/span><\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import math\n\nprint(math.copysign(10, -1)) # Output: -10.0\n<\/pre>\n<h3>Conclusion<\/h3>\n<p>The math module in Python provides a wide range of mathematical functions and constants that can be used to perform various mathematical calculations and operations. The module includes basic mathematical functions such as square root, trigonometric functions, logarithmic functions, and others, as well as mathematical constants such as pi and e.<\/p>\n<p>To use the functions and constants provided by the math module, you need to import it using the import statement. The math module is a built-in Python library, so it does not need to be installed separately. In conclusion, the math module in Python is a powerful tool for performing mathematical calculations and operations, and it is widely used in various scientific, engineering, and mathematical applications.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The majority of Python development involves mathematical calculations. It is impossible to avoid the need for math when working on a scientific project, a financial application, or any other type of programming project that&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":87323,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1053],"tags":[4898],"class_list":["post-87063","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python-math-module"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Math Module - Python for Mathematics - TechVidvan<\/title>\n<meta name=\"description\" content=\"Math module in Python provides a wide range of mathematical functions and constants to perform calculations and operations. Learn more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Math Module - Python for Mathematics - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Math module in Python provides a wide range of mathematical functions and constants to perform calculations and operations. Learn more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-24T05:11:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/03\/python-math-module.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Math Module - Python for Mathematics - TechVidvan","description":"Math module in Python provides a wide range of mathematical functions and constants to perform calculations and operations. Learn more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/","og_locale":"en_US","og_type":"article","og_title":"Python Math Module - Python for Mathematics - TechVidvan","og_description":"Math module in Python provides a wide range of mathematical functions and constants to perform calculations and operations. Learn more.","og_url":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2023-03-24T05:11:36+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/03\/python-math-module.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Python Math Module &#8211; Python for Mathematics","datePublished":"2023-03-24T05:11:36+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/"},"wordCount":1103,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/03\/python-math-module.webp","keywords":["Python Math Module"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/","url":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/","name":"Python Math Module - Python for Mathematics - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/03\/python-math-module.webp","datePublished":"2023-03-24T05:11:36+00:00","description":"Math module in Python provides a wide range of mathematical functions and constants to perform calculations and operations. Learn more.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/03\/python-math-module.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2023\/03\/python-math-module.webp","width":1200,"height":628,"caption":"python math module"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/python-math-module-python-for-mathematics\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Python Math Module &#8211; Python for Mathematics"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/87063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=87063"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/87063\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/87323"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=87063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=87063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=87063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}