{"id":646,"date":"2021-02-26T13:15:10","date_gmt":"2021-02-26T07:45:10","guid":{"rendered":"https:\/\/cbsepython.in\/?p=646"},"modified":"2021-09-28T12:03:05","modified_gmt":"2021-09-28T06:33:05","slug":"number-data-type-in-python","status":"publish","type":"post","link":"https:\/\/cbsepython.in\/number-data-type-in-python\/","title":{"rendered":"Number Data Type in python"},"content":{"rendered":"<h2><span style=\"color: #000000;\">Number Data Type in python<\/span><\/h2>\n<h2><span style=\"color: #000000;\">Python Numbers<\/span><\/h2>\n<p><span style=\"color: #000000;\">Number data types store numeric values. Number objects are created when you assign a value to them.<\/span><\/p>\n<p><span style=\"color: #000000;\">For example \u2212<\/span><\/p>\n<p><span style=\"color: #000000;\">var1 = var2 = 10<\/span><\/p>\n<p><span style=\"color: #000000;\">You can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212<\/span><\/p>\n<p><span style=\"color: #000000;\">del var1[,var2[,var3[&#8230;.,varN]]]]<\/span><\/p>\n<p><span style=\"color: #000000;\">You can delete a single object or multiple objects by using the del statement. For example \u2212<\/span><\/p>\n<p><span style=\"color: #000000;\">del vardel var_a, var_b<\/span><\/p>\n<p><span style=\"color: #000000;\">Python supports four different numerical types \u2212<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">int (signed integers)<\/span><\/li>\n<li><span style=\"color: #000000;\">long (long integers, they can also be represented in octal and hexadecimal)<\/span><\/li>\n<li><span style=\"color: #000000;\">float (floating point real values)<\/span><\/li>\n<li><span style=\"color: #000000;\">complex (complex numbers)<\/span><\/li>\n<\/ul>\n<h3><span style=\"color: #000000;\">Examples<\/span><\/h3>\n<p><span style=\"color: #000000;\">Here are some examples of numbers \u2212<\/span><\/p>\n<table width=\"551\">\n<tbody>\n<tr>\n<td><span style=\"color: #000000;\"><strong>Int<\/strong><\/span><\/td>\n<td><span style=\"color: #000000;\"><strong>Long<\/strong><\/span><\/td>\n<td><span style=\"color: #000000;\"><strong>float<\/strong><\/span><\/td>\n<td><span style=\"color: #000000;\"><strong>Complex<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">10<\/span><\/td>\n<td><span style=\"color: #000000;\">51924361L<\/span><\/td>\n<td><span style=\"color: #000000;\">0.0<\/span><\/td>\n<td><span style=\"color: #000000;\">3.14j<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">100<\/span><\/td>\n<td><span style=\"color: #000000;\">-0x19323L<\/span><\/td>\n<td><span style=\"color: #000000;\">15.20<\/span><\/td>\n<td><span style=\"color: #000000;\">45.j<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">-786<\/span><\/td>\n<td><span style=\"color: #000000;\">0122L<\/span><\/td>\n<td><span style=\"color: #000000;\">-21.9<\/span><\/td>\n<td><span style=\"color: #000000;\">9.322e-36j<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">080<\/span><\/td>\n<td><span style=\"color: #000000;\">0xDEFABCECBDAECBFBAEl<\/span><\/td>\n<td><span style=\"color: #000000;\">32.3+e18<\/span><\/td>\n<td><span style=\"color: #000000;\">.876j<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">-0490<\/span><\/td>\n<td><span style=\"color: #000000;\">535633629843L<\/span><\/td>\n<td><span style=\"color: #000000;\">-90.<\/span><\/td>\n<td><span style=\"color: #000000;\">-.6545+0J<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">-0x260<\/span><\/td>\n<td><span style=\"color: #000000;\">-052318172735L<\/span><\/td>\n<td><span style=\"color: #000000;\">-32.54e100<\/span><\/td>\n<td><span style=\"color: #000000;\">3e+26J<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"color: #000000;\">0x69<\/span><\/td>\n<td><span style=\"color: #000000;\">-4721885298529L<\/span><\/td>\n<td><span style=\"color: #000000;\">70.2-E12<\/span><\/td>\n<td><span style=\"color: #000000;\">4.53e-7j<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<ul>\n<li><span style=\"color: #000000;\">Python allows you to use a lowercase l with long, but it is recommended that you use only an uppercase L to avoid confusion with the number 1. Python displays long integers with an uppercase L.<\/span><\/li>\n<li><span style=\"color: #000000;\">A complex number consists of an ordered pair of real floating-point numbers denoted by x + yj, where x and y are the real numbers and j is the imaginary unit.<\/span><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Number Data Type in python Python Numbers Number data types store numeric values. Number objects are created when you assign a value to them. For example \u2212 var1 = var2 = 10 You can also delete the reference to a number object by using the del statement. The syntax of the del statement is \u2212 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-646","post","type-post","status-publish","format-standard","hentry","category-cbse-computer-science-with-python-class-12"],"_links":{"self":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/comments?post=646"}],"version-history":[{"count":0,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/posts\/646\/revisions"}],"wp:attachment":[{"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/media?parent=646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/categories?post=646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbsepython.in\/wp-json\/wp\/v2\/tags?post=646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}