所以我目前正在一个项目中,当我尝试从列表的特定范围提取数据时陷入困境。
我尝试在此处搜索一些解决方案,但没有成功。
ascii = [chr(i) for i in range(255)]
# list of ascii, all i want is to extract all digits[0-9] and [+,-] into another variable
a = '0123456789+-'
if any([x in a for x in enumerate(ascii)]):
ascii = ascii.replace(x, '')
print(ascii)