, , , , "else" "elif", , , .
1)
if numA < numB:
print('numA is smaller')
elif numB < numA:
print('numB is smaller')
else:
print('both numbers are equal')
2)
if numA < numB:
print('numA is smaller')
elif numB < numA:
print('numB is smaller')
elif numA == numB:
print('both numbers are equal')
I think it will not matter much, or am I mistaken? In other examples, I think the second option may be more "reliable."
user2015601
source
share