[Tutor] can someone explain the reason for error
vinod bhaskaran
bhaskaran.vinod at gmail.com
Wed Feb 7 06:58:20 EST 2018
Hi, I am a beginner level programmer and in one assignment the question
given is:to remove ',' from a list after getting a comma separated input
from console.
I gave the below (most print statements are for reference except the last
print statement). but i get the attached error. can someone explain why
this error nd how to rectify?
inputdata = input ('Enter comma separated data \n')
type(inputdata)
inputlist = list(inputdata)
print(inputlist)
a = len(inputdata)
print(a)
print ('xxxxxxxxxxxxxxxx')
for b in range(0,a):
print(a)
a = a - 1
print(inputlist)
inputlist.remove(',')
print(inputlist)
Thanks,
Vinod
More information about the Tutor
mailing list