I currently want my program to deal with string depending on what they contain:
if x.startswith("_") and "_" in x:
split_items = x.split("_")
convert_to_uppercase = [a.upper() for a in split_items]
split_items = [change.capitalize() for change in split_items]
final_items.append('_'.join(split_items))
elif not x.startswith("_") and not "_" in x:
final_items.append(x)
elif x.startswith("_") and not "_" in x:
final_items.append(x)
So for example I want _hellothere
, _hello_there
and hellothere
to be processed differently, is that possible using the existing if statements?