0
Hey guys where i am doing this wrong help me
lists= input() user_list= lists.split() final_list=[] for i in range(len(user_list)): new= i.replace(i[0],"") now=new+i[0]+"py" final_list.append(now) for x in range(len(final_list)): print(final_list[x],end=" ")
4 Answers
+ 1
for example if user_list = ["abc","def"]
for i in range (len(user_list)):
will be
for i in range(2)
now in loop i will become 0 and 1
so,basically u saying
0.replace()
which wont work
+ 1
Ohhhhhhh now i get it
thank-you
0
replace method is for string ,not int
0
But where i am using int