Question: Fix the following Python code that reads an integer from the user and prints out the absolute value of that integer. The absolute value

Fix the following Python code that reads an integer from the user

Fix the following Python code that reads an integer from the user and prints out the absolute value of that integer. The absolute value of a number is the magnitude of the number (i.e., a positive version of the number whether the original number is positive or negative). input.py userNum =input("Please type an integer ") absVal = -1 * userNum print (absVal) 123

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Python version 36 Python program to input an integer and displays the absolute ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!