Reference no: EM132330161
Question
Write a complete Python program that defines and calls a main() function with the following behavior:
Read an int num from the user, then two additional int values one and two. Finally, print out "num is between one and two" if either one > num > two or two > num > one. Otherwise, print "num is outside range".
Do this in two ways: first, using if-elif-else, then again, using ONLY if-else (no elif allowed). Which is easier to understand? For an extra challenge (but no Extra Credit), see if you can write this using only one if-else with no nesting. Hint: bool expressions and operators!
Now define a function is_between(num,one,two) which does the same comparison as above (any way is OK) and returns the appropriate string message. Don't print anything from within your function (no "chatterbox functions"). In your main() after the above, call your function, passing the three values entered by the user, then print out the returned string message