Skip to main content
 首页 » 编程设计

Python之从字符串中删除除某些字符外的所有内容

2025年05月04日21oomusou

<分区>

不知道以前有没有人问过这个问题,但是我找不到,所以在这里:

randomList = ["ACGT","A#$..G","..,/\]AGC]]]T"] 
randomList2 = [] 
for i in randomList: 
  if i <contains any characters other than "A",C","G", or "T">: 
    <add a string without junk to randomList2> 

我将如何做 <> 中的所有事情? 谢谢,