{"id":222,"date":"2023-03-18T09:46:08","date_gmt":"2023-03-18T09:46:08","guid":{"rendered":"https:\/\/joseph-t-gordon.tech\/?p=222"},"modified":"2023-06-26T14:23:18","modified_gmt":"2023-06-26T14:23:18","slug":"post-35-the-input-function","status":"publish","type":"post","link":"https:\/\/joseph-t-gordon.tech\/index.php\/2023\/03\/18\/post-35-the-input-function\/","title":{"rendered":"Post #35 (Python Programming) &#8211; The input() function"},"content":{"rendered":"\n<p>While print() is used to display data from the console, the input function accepts data from the console. You can set the input to a variable and use it in your code. You can also convert your input into a different data type by default it is a string str() but you can change it via int(), float(), etc. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>code:<\/p>\n\n\n\n<p>var = input(&#8220;Please enter your input here: &#8220;)<\/p>\n\n\n\n<p>print(var*5)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>result:<\/p>\n\n\n\n<p>Please enter your input here<\/p>\n\n\n\n<p>>>> 1<\/p>\n\n\n\n<p>11111<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>code:<\/p>\n\n\n\n<p>var = int(input(&#8220;Please enter your input here: &#8220;))<\/p>\n\n\n\n<p>print(var*5)<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>result: <\/p>\n\n\n\n<p>Please enter your input here: <\/p>\n\n\n\n<p>>>> 1<\/p>\n\n\n\n<p>5<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>While print() is used to display data from the console, the input function accepts data from the console. You can set the input to a variable and use it in your code. You can also convert your input into a different data type by default it is a string str() but you can change it&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","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},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/posts\/222"}],"collection":[{"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":2,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":319,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/posts\/222\/revisions\/319"}],"wp:attachment":[{"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joseph-t-gordon.tech\/index.php\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}