Read the question, write Python on the right, then Run or Check.
QuestionHint and solution stay closed until you open them
Read two integers and print their absolute difference (|a − b|).
Use abs() so you do not need to worry which is larger.
Input. One line: two integers a and b.
Output. One non-negative integer.
Examples
Input
10 3
Output
7
Input
3 10
Output
7
Hint
- print(abs(a - b))
Show correct code
Peek only after you have tried. You can still Check your own version.
a, b = map(int, input().split())
print(abs(a - b))
main.pyPython · Ctrl + Enter runs
ResultIdle
Run to see output. Check grades the tests.