Question: Write a Python program to receive two numbers from the user, and print the results of their multiplication. Two important issues: You must name


Write a Python program to receive two numbers from the user, and print the results of their multiplication. Two important issues: You must name your code file multiplier.py. The input and output format of your programs must be identical to the examples provided in Table 1. Input Two numbers will be given to your program -as user input- in one line, separated from each other by a space. To take the user multiple inputs in one line use the following line of code: x, y input ().split() Input 11 3-1 80 -4-22 = Output You should simply print the result of multiplication in the output. Table 1: Samples of Provided Inputs and Expected Outputs Output -3 0 88 Task 4 Improve this program! The user should only be able to enter sensible numeric values for temperatures in Celsius (e.g., 4.7, -10, 143.5). Start by adding the following code to the top of your program. I'll go through it in more detail later in the course. Note: if copying from a PDF viewer, the indentation levels may not get copied correctly. If this happens, be sure to manually add the indentation levels (4 spaces per level). def isfloat(num): try: float(num) return True except ValueError: return False The above code will enable you to check if a given string is a float value, by writing, e.g., isfloat(celsius). Now, modify your code from Task 3, using the isfloat(...) function to make sure that the user has entered a value between, say, -200 and 200. If the value is valid, the program continues and converts the value to Fahrenheit as before. Otherwise, the program should tell the user that their value was invalid, and should prompt them for a new one. If you're doing this with an if-else block, it will only check once whether the value is valid. For bonus points, try to have the program repeat the check until the user enters a valid value. Hint: the best approach will include a while loop. See the below articles: W3Schools - Python While Loops Programiz Python while Loop
Step by Step Solution
3.42 Rating (149 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
