I tried to use raw_input()
to get a list of numbers, however with the code
numbers = raw_input()
print len(numbers)
the input
You can use this function (with int type only) ;)
def raw_inputList(yourComment):
listSTR=raw_input(yourComment)
listSTR =listSTR[1:len(listSTR)-1]
listT = listSTR.split(",")
listEnd=[]
for caseListT in listT:
listEnd.append(int(caseListT))
return listEnd
This function return your list (with int type) !
Example :
yourList=raw_inputList("Enter Your List please :")
If you enter
"[1,2,3]"
then
yourList=[1,2,3]