{"id":1523,"date":"2023-05-21T08:33:41","date_gmt":"2023-05-21T08:33:41","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.com\/?p=1523"},"modified":"2023-05-21T08:33:41","modified_gmt":"2023-05-21T08:33:41","slug":"write-python-code-to-find-average-via-loop","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2023\/05\/21\/write-python-code-to-find-average-via-loop\/","title":{"rendered":"Write Python code to find average via loop"},"content":{"rendered":"\n<p>Here is a code to find average via loop:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def cal_average(num):\n    sum_num = 0\n    for t in num:\n        sum_num = sum_num + t           \n\n    avg = sum_num \/ len(num)\n    return avg\n\nprint(\"The average is\", cal_average([18,25,3,41,5]))<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is a code to find average via loop: def cal_average(num): sum_num = 0 for&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1523"}],"collection":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/comments?post=1523"}],"version-history":[{"count":1,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1523\/revisions"}],"predecessor-version":[{"id":1524,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1523\/revisions\/1524"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=1523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=1523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=1523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}