You are viewing a single comment's thread. Return to all comments →
Approach A: We can use f string
print(f'{a+b}\n{a-b}\n{a*b}')
Approach B: if name == 'main': a = int(input()) b = int(input())
result = (a+b, a-b, a*b) print(*result, sep='\n')
*result will unpack the tuple, 'sep' argument of print will separate the values in tuple with new line
A
Seems like cookies are disabled on this browser, please enable them to open this website
Arithmetic Operators
You are viewing a single comment's thread. Return to all comments →
Approach A: We can use f string
print(f'{a+b}\n{a-b}\n{a*b}')
Approach B: if name == 'main': a = int(input()) b = int(input())
*result will unpack the tuple, 'sep' argument of print will separate the values in tuple with new line
A