Check the Numeric Type (Exercise)
00:00 This is the final exercise in this section, and in fact, the entire course. You are going to write another program that will ask the user to provide two numbers.
00:10 Then you’ll calculate their difference and determine whether the difference between both numbers is an integer or not.
00:18
Here’s a sample run of the program. In this case, the values the user provided are 1.5
and .5
. Because their difference is equal to exactly 1
, the result is indeed a whole number. On the other hand, if the difference works out to be a fraction, then your program should reflect that by printing False
instead of True
.
00:41 Now go ahead and try to solve this exercise on your own.
Become a Member to join the conversation.