I'm looking for a solution to removing the trailing white space when inputting a string of numbers.
Code
vals_inp=input()
print('vals_inp',vals_inp)
vals_strip = vals_inp.rstrip()
print('vals_strip', vals_strip, type(vals_inp))
in_set=set(vals_strip) # problem happens here
OUTPUT
in_set {'1', '2', '3', ' '} #PROBLEM ' '
Things tried
I have tried rstrip lstrip rstrip and strip(' ') I see lots of answers using rstrip etc but its not working for me
Why it matters
The ' ' in my set is messing up the subsequent code. All help appreciated