The problem is that you are comparing strings and not numbers, so when you compare "10" to "3" the first is less, because analysis is done character by character, so the comparison is the character "1" with the character "3", and of course "3" is larger. This does not work, and to function as you will have to do strings in% with% s.
But there is a problem, you can not guarantee that all items can be converted. You'll have to treat the exception that will be generated by turning the text into an integer, so the code gets a bit more complicated.
a = 'joao 1 0 10 2 3'
b = a.split()
c = []
for i in b:
try:
c.append(int(i))
except ValueError:
pass
print(max(c))
print(min(c))
See running on ideone . And no Coding Ground . Also put it in GitHub for future reference .
Obviously the question does not clarify what to do with string s, I had the understanding that should ignore and not generate error, after all the code would not be useful, and would not give the result that the AP asked in the question with input, and I considered that the input example cited is just to facilitate, that could or may not have texts even in the middle of the numbers in any position.