I've been looking into how to create a program that removes any whitespaces/special characters from user input. I wan't to be left with just a string of numbers but I've not been able to work out quite how to do this. Is it possible anyone can help?
x = (input("Enter a debit card number: ")) x.translate(None, '!.;,') print(x) The code I have created is possibly to basic but yeah, it also doesn't work. Can anyone please help? :) I'm using Python3.