{"id":11054,"date":"2022-06-13T01:14:37","date_gmt":"2022-06-12T22:14:37","guid":{"rendered":"https:\/\/elzero.org\/?p=11054"},"modified":"2022-06-13T01:34:47","modified_gmt":"2022-06-12T22:34:47","slug":"python-check-if-variable-is-int-str-float","status":"publish","type":"post","link":"https:\/\/elzero.org\/old\/python-check-if-variable-is-int-str-float\/","title":{"rendered":"\u0641\u062d\u0635 \u0625\u0630\u0627 \u0643\u0627\u0646 \u0627\u0644\u0645\u062a\u063a\u064a\u0631 str \u0623\u0648 int \u0623\u0648 float"},"content":{"rendered":"<div class=\"text\">\r\n\u0641\u062d\u0635 \u0646\u0648\u0639 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0627\u0644\u0645\u0648\u062c\u0648\u062f\u0629 \u0641\u064a \u0627\u0644\u0645\u062a\u063a\u064a\u0631 \u0628\u0623\u0643\u062b\u0631 \u0645\u0646 \u0637\u0631\u064a\u0642\u0629\r\n<\/div>\r\n\r\n<h3>\u0628\u0625\u0633\u062a\u062e\u062f\u0627\u0645 Type + Comparison Operator<\/h3>\r\n\r\n<script type=\"text\/plain\" class=\"language-python\">\r\nmy_number = 100\r\nmy_string = \"Elzero\"\r\nmy_float = 100.5\r\n\r\n# With Type And Comparison Operator\r\n\r\nprint(type(my_number) == int)  # True\r\nprint(type(my_string) == str)  # True\r\nprint(type(my_float) == float)  # True\r\n<\/script>\r\n\r\n<h3>\u0628\u0625\u0633\u062a\u062e\u062f\u0627\u0645 Is Instance + Class<\/h3>\r\n\r\n<script type=\"text\/plain\" class=\"language-python\">\r\nmy_number = 100\r\nmy_string = \"Elzero\"\r\nmy_float = 100.5\r\n\r\n# With Is Instance + Class\r\n\r\nprint(isinstance(my_number, int))  # True\r\nprint(isinstance(my_string, str))  # True\r\nprint(isinstance(my_float, float))  # True\r\n<\/script>","protected":false},"excerpt":{"rendered":"<p>\u0641\u062d\u0635 \u0646\u0648\u0639 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a \u0627\u0644\u0645\u0648\u062c\u0648\u062f\u0629 \u0641\u064a \u0627\u0644\u0645\u062a\u063a\u064a\u0631 \u0628\u0623\u0643\u062b\u0631 \u0645\u0646 \u0637\u0631\u064a\u0642\u0629<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[613],"tags":[1319,1318,107,666,883,1317,458,569,480,711,885,1320],"class_list":["post-11054","post","type-post","status-publish","format-standard","hentry","category-python-tutorials","tag-check","tag-classk","tag-code","tag-float","tag-integer","tag-isinstance","tag-python","tag-string","tag-tutorial","tag-711","tag-885","tag-1320"],"_links":{"self":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/11054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/comments?post=11054"}],"version-history":[{"count":1,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/11054\/revisions"}],"predecessor-version":[{"id":11055,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/11054\/revisions\/11055"}],"wp:attachment":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/media?parent=11054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/categories?post=11054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/tags?post=11054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}