I want to add a constant value as prefix in each elements of list. I want to do something similar to this post . But above answers are using for loop. I want to aviod for loops in my program.
My objective is I have to create a list it values should be "unknown contact number 0", "unknown contact number 1","unknown contact number 2"..."unknown contact number n".
here unknown contact number
is my prefix. I want to add this element in my list.
So far I tried this,
x=pd.DataFrame(index=range(val))
print ('unknown contact number '+x.index.astype(str)).values.tolist()
My question is Am I adding more complex to my code to avoid for loops? or any other better approaches to solve this problem?
Thanks in advance.