To convert the given string into a list in Python, you can use the eval() function. However, the string you provided seems to be invalid as it contains unnecessary quotation marks and is missing closing quotation marks for the first email address. Here's the corrected version of the string:

string = "['hiu.c.com', 'jerry.kcc.com', 'hiu.chauc.com']"

Now, you can convert this string into a list using the eval() function as follows:

lst = eval(string)

The resulting lst will be a list containing the email addresses:

['hiu.c.com', 'jerry.kcc.com', 'hiu.chauc.com']
``
python hiuccom jerrykcccom hiuchauccom to list

原文地址: https://www.cveoy.top/t/topic/hAYy 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录