<\/a>s<\/p>\n There is the code I made to put at work the conditionals. The program basicaly tells you if the number you typed is a float, an integer, a negative integer, or a negative float.<\/p>\n So first you ask for the number<\/p>\n x = input ( “Number” )<\/p>\n easy, then here comes the conditional.<\/p>\n if is called conditional, python will run everything “inside” the if, IF the condition inside the parenthesis is true<\/p>\n So first I will ask python if the number the user gave me is a negative float; if it has a “-” and a “.”<\/p>\n to do it, I store the point in a token name floatt, and the minus in a token named minus<\/p>\n minus = “-” \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0floatt = “.”<\/p>\n <\/a><\/p>\n So \u00a0 \u00a0<\/span><\/p>\n if ( (floatt in x) and (minus in x)):<\/span> What you are typing is: IF<\/span> the point storaged in FLOATT<\/span> is inside the number stored in X<\/span>, AND<\/span> the minus storaged in MINUS<\/span> is inside the number stored in X<\/span>, then it is a negative float, and the program will say it to you.<\/p>\n <\/a><\/p>\n We already have the condition to a negatiuve float, but we don’t have he conditions of float or negative.<\/p>\n But we can’t put another if because the program will run the first condition, then the second one, and so on, so a negative float is a negative and a float, that’s why elif is so useful.<\/p>\n You can ask, if the IF conditions didn’t met, another condition with elif.<\/p>\n So<\/p>\n elif (floatt in x):<\/span> elif (minus in x):<\/span> You are asking only when\u00a0the first coindition don’t met if FLOATT \u00a0<\/span>is inside of X<\/span>, if not, then you ask if MINUS<\/span> is inside X<\/span>.<\/p>\n <\/a><\/p>\n Finally, if none of the previus conditions were met, ELSE<\/span> finally gets into scene, then it is a integer,<\/p>\n So<\/p>\n else:<\/span> An that is pretty much all! You know how to use if, elif, else conditionals!<\/p>\n <\/a> <\/p>\n","protected":false},"excerpt":{"rendered":" s There is the code I made to put at work the conditionals. The program basicaly tells you if the number you typed is a float, an integer, a negative integer, or a negative float. So first you ask for… Continue Reading →<\/a><\/p>\n","protected":false},"author":191,"featured_media":20774,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[113,114,116,45,39],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/20778"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/users\/191"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=20778"}],"version-history":[{"count":3,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/20778\/revisions"}],"predecessor-version":[{"id":21930,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/20778\/revisions\/21930"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media\/20774"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=20778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=20778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=20778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}if<\/span><\/h1>\n
\n\u00a0 \u00a0 \u00a0 print (“It is a negative float”)<\/span><\/p>\nelif<\/span><\/h1>\n
\n\u00a0 \u00a0 \u00a0 \u00a0print \u00a0( “It is a float” )<\/span><\/p>\n
\n\u00a0 \u00a0 \u00a0 \u00a0print ( “It is a negative number”)<\/span><\/p>\nelse<\/span><\/h1>\n
\n\u00a0 \u00a0 \u00a0 print ( “It is an integer” )<\/span><\/p>\n