简体   繁体   English

如何将具有多个字符的字符串转换为列表,并且每个字符都是 python 中的字符串 [暂停]

[英]How to convert a string with many characters to a list and that each character is a string in python [on hold]

The problem is:问题是:

x = ['ATACTTTACGCAGCGCGGAGTTCGGTTTTGTAGGAGTGGTAGTATATACACGAGTACAT']

Convert To:转换成:

LIST = ['A' , 'T', 'A', 'C', 'T', 'T', 'T', 'A', 'C', 'G', 'C', 'A', 'G', 'C', 'G', 'C', 'G', 'G', 'A', 'G', 'T', 'T', 'C', 'G', 'G', 'T', 'T', 'T', 'T', 'G', 'T', 'A', 'G', 'G', 'A', 'G', 'T', 'G', 'G', 'T', 'A', 'G', 'T', 'A', 'T', 'A', 'T', 'A', 'C', 'A', 'C', 'G', 'A', 'G', 'T', 'A', 'C', 'A', 'T']

This will do it:这将做到:

x_list = [n for n in x[0][:]]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Python中将字符串的每个字符转换为list元素的各个元素? - How to convert each character of a string into individual elements of list element in Python? 如何使用Python转换字符串中的每个字符 - How to Convert Each Character in a String using Python 在python中没有空格的每个字符后将输入字符串转换为列表 - Convert input String to List after each character without spaces in python 在列表中,如何将每个字符串(带有混合特殊字符)分隔为单个字符? - In a list, how to separate each string (with mixed special characters) into a single character? 如何将字符串拆分为字符列表,然后按每个字符连接 - How to split a string into list of characters and then concatenate by each character 将带有字符的列表转换为字符串(Python) - Convert a list with characters to a string (Python) 如何在 Python 中将字节转换为相同长度的字符串(每个字节 1 个字符)? - How to convert bytes to a string of the same length in Python (1 character for each byte)? Python如何将字符转换为字符串 - Python how to convert character to string 如何在python中将\\ 1字符转换为字符串 - How to convert \1 character as a string in python 如何将列表转换为字符串忽略python中的其他字符? - how to convert list to string ignoring other characters in python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM