[PYTHON] String conversion of a list containing numbers

Conversion of each element to a string

If the list contains some numbers, use map to convert them all to strings.

>>>list = [0,1,2,3,4,5]
>>>map(str,list)
['0', '1', '2', '3', '4', '5']

Also, when you want to separate these elements with "," etc. into one character string, you can write it in one line.

>>>','.join(map(str,list))
'0,1,2,3,4,5'

Convenient when sending data measured by a sensor or the like.

Recommended Posts

String conversion of a list containing numbers
Display output of a list of floating point numbers
Convert a slice object to a list of index numbers
[Command] Command to get a list of files containing double-byte characters
Extract the value of dict or list as a string
How to connect the contents of a list into a string
Generate a list of consecutive characters
Conversion of string <-> date (date, datetime) in Python
Display a list of alphabets in Python 3
Get a Unicode JSON string containing Japanese.
[python] Get a list of instance variables
[Python] Get a list of folders only
A memorandum of python string deletion process
[python] Create a list of various character types
converting argument $ 1 type: unsupported type [] string, a slice of string
Note) Batch conversion of specific symbols contained in a character string with a dictionary
Make a copy of the list in Python
Get a list of IAM users with Boto3
Extract lines containing a specific "string" in Pandas
Get a list of Qiita likes by scraping
[Linux] A list of Linux commands that beginners should know
Cut a part of the string using a Python slice
Add a list of numpy library functions little by little --a
How to write a list / dictionary type of Python3
Make a note of the list of basic Pandas usage
# Function that returns the character code of a string
Basics of Python learning ~ What is a string literal? ~
A script that outputs a list of SoftLayer portal users
Python: Get a list of methods for an object
Group by consecutive elements of a list in Python
Display a list of frequently used commands on Zsh
List of python modules
Copy of multiple List
Hexadecimal string and string conversion
List of activation functions (2020)
Summary of string operations
Output unicode string list
Depth of nested list
Display of fractions (list)
Add a list of numpy library functions little by little --- b
Find out the apparent width of a string in python
[Python] How to make a list of character strings character by character
How to shuffle a part of a Python list (at random.shuffle)
Add a list of numpy library functions little by little --c
Get the number of specific elements in a python list
Get a list of purchased DMM eBooks with Python + Selenium
Since Python 1.5 of Discord, I can't get a list of members
Garbled characters when printing an array containing a string containing utf-8
CLI tool that just outputs a list of prefectures quickly
How to display a list of installable versions with pyenv
How to get a list of built-in exceptions in python
Python: Create a dictionary from a list of keys and values
[Addition] A memo for dividing a character string containing multiple spaces
Python> Read from a multi-line string instead of a file> io.StringIO ()
How to get a list of links from a page from wikipedia
Is there a secret to the frequency of pi numbers?