{"id":32662,"date":"2023-11-23T20:32:21","date_gmt":"2023-11-23T16:32:21","guid":{"rendered":"https:\/\/www.lifeyet.com\/?p=32662"},"modified":"2024-10-05T07:35:58","modified_gmt":"2024-10-05T07:35:58","slug":"how-to-calculate-pi-with-python","status":"publish","type":"post","link":"https:\/\/lifeyet.com\/how-to-calculate-pi-with-python\/","title":{"rendered":"How to calculate Pi with Python"},"content":{"rendered":"\n<p id=\"1d18\">I am sure that many of you have wonder at least once in your live what is PI really? and how you can calculate it.<\/p>\n\n\n\n<p id=\"91a7\">This is going to be a short post and i\u2019ll try to keep it as simple as possible.<\/p>\n\n\n\n<p id=\"1dd8\"><strong>So first let\u2019s begin explaining what pi actually is?<\/strong><\/p>\n\n\n\n<p id=\"69f4\">We can define Pi as a mathematical constant. It is defined as the ratio of a circle\u2019s circumference to its diameter, but Pi it\u2019s more than just that it\u2019s turn out to be like i said before an mathematical constant and it appear in many different branches of math.<\/p>\n\n\n\n<p id=\"2509\">In this post i will teach you the one that i think is the easiest one.<\/p>\n\n\n\n<p id=\"2afd\">we will begin knowing that \u03c0\u00b2\/6 is equal to the sums of the inverse of all natural number power 2<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/miro.medium.com\/v2\/resize:fit:630\/1*vqHTWnm4kEP3yuCkJ47X6w.jpeg\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"28bc\">this is the Basel problem prove by Euler in 1734. And its look kind of weird but trust me its really easy.<\/p>\n\n\n\n<p id=\"c5e4\">we can express it like this:<\/p>\n\n\n\n<p id=\"03e0\">(1\/1\u00b2)+(1\/2\u00b2)+(1\/3\u00b2)+(1\/4\u00b2)+(1\/5\u00b2)+(1\/6\u00b2)+(1\/7\u00b2)+(1\/8\u00b2)+(1\/9\u00b2)+\u2026<\/p>\n\n\n\n<p id=\"34cf\">thats and equal to somethis like 1.64493306684777\u2026<\/p>\n\n\n\n<p id=\"f87d\">So now we know that \u03c0\u00b2\/6=1.64493306684777, so we can find out pi by clearing the equation and it\u2019s end up like \u03c0\u00b2=(1.64493306684777)(6)<\/p>\n\n\n\n<p id=\"248d\">and that\u2019s equal to 3.1415.<\/p>\n\n\n\n<p id=\"6cf0\">So now that we know how to calculate pi let\u2019s code it.<\/p>\n\n\n\n<p id=\"c9b7\">So as you may notice it\u2019s took the range from 1 to 1000000 that\u2019s because it is and aproximation and we get closer to the actual real number of pi increasing the range of number to use.<\/p>\n\n\n\n<p id=\"f698\">I hope that you actually learned something in this post otherwise this is my first post and i will try to get better at it.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Note:&nbsp;<\/h1>\n\n\n\n<p>Are you a <strong>content creator<\/strong>? If yes then we welcome bloggers &amp; they can submit a <strong>guest post<\/strong> to our famous blog for free, just search in <a href=\"https:\/\/www.google.com\"><strong>google<\/strong><\/a>, we are on top of search engine \u201c <a href=\"https:\/\/www.lifeyet.com\/write-for-us\/\"><strong>write for us<\/strong> <strong>+ travel<\/strong><\/a>\u201d, You will find \u201c<a href=\"https:\/\/lifeyet.com\"><strong>Lifeyet News<\/strong><\/a>\u201d.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am sure that many of you have wonder at least once in your live what is PI really? and how you can calculate it. This is going to be a short post and i\u2019ll try to keep it as simple as possible. So first let\u2019s begin explaining what pi actually is? We can define [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":32663,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[18],"tags":[7491,6757,485,727,162,10,397,7193,7194,6758,82,6759,6760,755,5026,345,6762,934,6763,473,6764,412,17,774,6765,387,1201,149,6766,4472,194],"yst_prominent_words":[],"class_list":["post-32662","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-basel-problem-in-python","tag-bbc-news","tag-canada","tag-facebook","tag-fashion","tag-featured","tag-google","tag-google-adsense","tag-google-news","tag-google-trend","tag-home","tag-hot-topic","tag-instablog","tag-instagram","tag-latest","tag-lifestyle","tag-lifestyleblog","tag-new","tag-new-york-news","tag-news","tag-snapchat","tag-tiktok","tag-top","tag-trending","tag-twitter","tag-uk","tag-update","tag-usa","tag-usa-news","tag-wikipedia","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/posts\/32662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/comments?post=32662"}],"version-history":[{"count":1,"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/posts\/32662\/revisions"}],"predecessor-version":[{"id":35208,"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/posts\/32662\/revisions\/35208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/media\/32663"}],"wp:attachment":[{"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/media?parent=32662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/categories?post=32662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/tags?post=32662"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/lifeyet.com\/wp-json\/wp\/v2\/yst_prominent_words?post=32662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}