I'm trying to replace more than one character in a string with the replace function, but I can't figure out how to achieve this.
from itertools import permutations
comb = permutations([1, 2, 3, 4, 5, 6, 7, 8, 9, 0], 6)
f = open("code.txt", "w")
for i in comb:
nums = str(i)
cleared = nums.replace(',' or ' ' or '(' or ')', '')
print(cleared)
f.write(cleared + "\n")
That's what I've got so far. My problem is that the 'or' on line 6 doesn't work so only the commas get removed. Can anyone help?