map()
is your friend, it applies the function given as first argument to all items in the list.
map(int, yourlist)
since it maps every iterable, you can even do:
map(int, input("Enter the unfriendly numbers: "))
which (in python3.x) returns a map object, which can be converted to a list.
I assume you are on python3, since you used input
, not raw_input
.