Chỉ cần tò mò về cách bạn có '1', '2', '3', ' 4 'thay vì 1, 2, 3, 4. Dù sao đi nữa.
>>> list1 = list(input("Enter the unfriendly numbers: "))
Enter the unfriendly numbers: 1, 2, 3, 4
>>> list1 = list(input("Enter the unfriendly numbers: "))
Enter the unfriendly numbers: [1, 2, 3, 4]
>>> list1
[1, 2, 3, 4]
>>> list1 = list(input("Enter the unfriendly numbers: "))
Enter the unfriendly numbers: '1234'
>>> list1 = list(input("Enter the unfriendly numbers: "))
Enter the unfriendly numbers: '1', '2', '3', '4'
>>> list1
['1', '2', '3', '4']
Alright, một số mã
>>> list1 = input("Enter the unfriendly numbers: ")
Enter the unfriendly numbers: map(int, ['1', '2', '3', '4'])
>>> list1
[1, 2, 3, 4]
có thể trùng lặp của [Chuyển đổi tất cả các chuỗi trong một danh sách để int] (http://stackoverflow.com/questions/7368789/convert-all-strings-in-a-list-to-int) –