- 1
How can I add an int to. List in python
3 Answers
+ 4
list.append(<int>)
+ 1
Nathan
input method will always give you a string, if you want an integer you need to convert it using int( ).
You can try:
number = int(input( ))
0
Input = input()
#lets assume the input entered were integers
Input = list(input)
# it will be ['1','2'] instead of [1,2] now how do I make it [1,2]