zoukankan      html  css  js  c++  java
  • Python技巧—list与字符串互相转换

    Python技巧—list与字符串互相转换

    Python的编程中,经常会涉及到字符串与list之间的转换问题,下面就将两者之间的转换做一个梳理。

    1、list转换成字符串

    命令:list()

    例子:

    2、字符串转换成list

    命令:"".join(list)

    其中,引号中是字符之间的分割符,如“,”,“;”,“ ”等等

    例子:数据分析师培训

  • 相关阅读:
    403
    311
    401
    310
    308
    309
    307
    304
    3-1
    2-11
  • 原文地址:https://www.cnblogs.com/amengduo/p/9587130.html
Copyright © 2011-2022 走看看