https://paiza.jp/works/mondai/conditions_branch/conditions_branch__complex_boss
私の回答
a,b=[int(x) for x in input().split()]
if a<0 and b<0:
print(b*b)
elif a<0 and b>0:
print(a*b)
elif a==0 or b==0:
print(0)
elif a>0 and b>0:
print(a*a)
elifでプログラムを終了してしまい、中途半端になってしまいました。
模範回答
a, b = [int(x) for x in input().split()]
if a <= 0 and b >= 0:
# a から b の間に 0 が含まれる
print(a * b)
elif a > 0:
# a と b が両方とも正の数
print(a * a)
else:
# a と b が両方とも負の数
print(b * b)