תשובה אחת
num = int(input("type a positive 4-digit number: "))
min1 = 9 # initialize with largest possible digit
for i in range(4):
tmp = num % 10
if min1 > tmp:
min1 = tmp
num = num // 10 # need to divide the number by 10 to check the next digit
print(min1)