I'm new to python and I'm trying to do the "Band name generator" kata on codewars but I'm having trouble with the join function and I do not know why. It says "can only join an iterable" but I am trying to join a list which is an iterable so I do not understand what is the issue here and how to solve this. Thank you so much in advance!
import re
regex = r'^[a-z]$|^([a-z]).*\1$'
def split(name):
return [char for char in name]
def band_name_generator(name):
if (re.search(regex, name)):
x = split(name).append(split(name)[1:])
return "".join(x)
else:
return "The " + name.capitalize()
print(band_name_generator("alaska"))