Convert strings to character-by-character list format with python

For strings

#Thing you want to do
#'hello' ⇒ ['h','e','l','l','o']

a = 'hello'
print(list(a))

The execution result is as follows

['h', 'e', 'l', 'l', 'o']

In the case of numerical value

b = 123456789
print(list(str(b)))

The execution result is as follows

['1', '2', '3', '4', '5', '6', '7', '8', '9']

Recommended Posts

Convert strings to character-by-character list format with python
Convert list to DataFrame with python
[Python] Convert list to Pandas [Pandas]
Python> list> Convert double list to single list
Convert memo at once with Python 2to3
Convert Excel data to JSON with python
Convert Hiragana to Romaji with Python (Beta)
Convert FX 1-minute data to 5-minute data with Python
python> Convert tuple to list> aList = list (pi_tuple)
Convert Python date types to RFC822 format
Convert HEIC files to PNG files with Python
Convert Chinese numerals to Arabic numerals with Python
Sample to convert image to Wavelet with Python
Convert PDF to image (JPEG / PNG) with Python
Convert 202003 to 2020-03 with pandas
Convert PDFs to images in bulk with Python
Convert svg file to png / ico with Python
Convert Windows epoch values to date with python
Preprocessing with Python. Convert Nico Nico Douga tag search results to CSV format
Initialize list with python
How to convert / restore a string with [] in python
Convert the image in .zip to PDF with Python
How to convert JSON file to CSV file with Python Pandas
PyInstaller memorandum Convert Python [.py] to [.exe] with 2 lines
Convert / return class object to JSON format in Python
Try to automate pdf format report creation with Python
[python] Convert date to string
Convert numpy int64 to python int
[Python] How to use list 1
Connect to Wikipedia with Python
Post to slack with Python 3
Convert Scratch project to Python
[Python] Convert Shift_JIS to UTF-8
Switch python to 2.7 with alternatives
Write to csv with Python
[Introduction to Python] <list> [edit: 2020/02/22]
Format json with Vim (with python)
String format with Python% operator
Convert python 3.x code to python 2.x
[Python] How to make a list of character strings character by character
How to convert an array to a dictionary with Python [Application]
Python / datetime> Implementation to convert YYYYMMDD format to YYYY / MM / DD
Convert video to black and white with ffmpeg + python + opencv
Convert .ipynb to .html (with BatchFile)
Python: How to use async with
Link to get started with python
[Python] Write to csv file with Python
Create folders from '01' to '12' with python
Nice to meet you with python
Try to operate Facebook with Python
[Introduction to Python3 Day 13] Chapter 7 Strings (7.1-7.1.1.1)
Output to csv file with Python
Workflow to convert formula (image) to python
[Introduction to Python3 Day 14] Chapter 7 Strings (7.1.1.1 to 7.1.1.4)
MP3 to WAV conversion with Python
Convert sentences to vectors with gensim
To do tail recursion with Python2
How to get started with Python
[Introduction to Python3 Day 15] Chapter 7 Strings (7.1.2-7.1.2.2)
What to do with PYTHON release?
[Python] How to use list 3 Added