Answer:
Here's the Python code to achieve the given task:
num1 = int(input("Enter a number: "))
num2 = int(input("Enter a number: "))
num3 = int(input("Enter a number: "))
smallest = num1
if num2 < smallest:
smallest = num2
if num3 < smallest:
smallest = num3
print("Smallest: " + str(smallest))
Step-by-step explanation:
1. We use the input() function to take three numbers as input from the user and convert them to integers using the int() function.
2. We initialize the smallest variable to be the first number entered (num1).
3. We compare smallest to num2 and num3 using if statements and update smallest accordingly if one of these is smaller.
4. Finally, we print the value of smallest as a string using the str() function.