Write a function that takes a list as the argument and returns a list with each element shifted left by one index and in case of string characters it needs to shift the characters to one space in the left as well. But the problem is the remove object doesnt remove more than one string object.Can anyone suggest the right way?
def shuffle_lst(inputs):
i=0
j=0
z=0
if isinstance(inputs,list)==False:
raise Exception('The entered value should be a list, but the entered value is: {}'.format(my_string))
else:
for i in range(0,len(inputs)):
if isinstance(inputs[i],int)==True or isinstance(inputs[i],str)==True:
final_str2=inputs[1:]+inputs[0:1]
final_str2_copy=copy.deepcopy(final_str2)
[final_str2.remove(j) for j in final_str2 if(type(j) is str)]
print(final_str2)
for z in range(0,len(final_str2_copy)):
if isinstance(final_str2_copy[z],str)==True:
final_str=final_str2_copy[z][1:]+final_str2_copy[z][0:1]
final_str2.append(final_str)
print(final_str2)