I am trying to write a function strip white-spaces from the left hand side a string.
def main():
str_strip = input('enter a string of which whitespace are stripped: ')
cs-strip(str_strip)
def cs-strip(str_strip):
i = 0
temp = list(str_strip)
if temp[0] == ' ':
temp.remove(temp[0])
elif temp[0] == '\' :
if temp[1] == 'n' or temp[1] == 't':
temp.remove(temp[0])
temp.remove(temp[0])
new = ''.join(map(str,temp))
print(new)
main()
But I cant quote compare '\' with other strings, I have tried '''\''', it still doesn't work. How can I compare string when string is or includes '\'?