답변 1
0
이렇게 해보세요.
첫번째 코드
data1 = int(input("data1 is : "))
data2 = int(input("data2 is : "))
data3 = int(input("data3 is : "))
numbers = [data1, data2, data3]
print("Smallest element is: ", min(numbers))
두번째 코드
num1 = int(input('Enter First number : '))
num2 = int(input('Enter Second number : '))
num3 = int(input('Enter Third number : '))
if (num1 < num2) and (num1 < num3):
smallest_num = num1
elif (num2 < num1) and (num2 < num3):
smallest_num = num2
else:
smallest_num = num3
print("The smallest of the 3 numbers is : ", smallest_num)