当前位置:网站首页>How to turn a multi digit number into a digital list
How to turn a multi digit number into a digital list
2022-07-06 20:38:00 【huaMinPython】
n=19
Method 1:
1. First convert numbers into strings .str(n)
2. Then convert the string into a string list .list(str)
3. Finally, convert each element into int.【int(i) for i in list】
l=[int(i) for i in list(str(n))]
Method 2:
use map(int,【】) function
l=list(map(int,list(str(n))))
n=19
# Method 1
#l=[int(i) for i in list(str(n))]
# Method 2
l=list(map(int,list(str(n))))
print(l)
边栏推荐
- [Yann Lecun likes the red stone neural network made by minecraft]
- Detailed introduction of distributed pressure measurement system VIII: basic introduction of akka actor model
- 持续测试(CT)实战经验分享
- Jupyter launch didn't respond after Anaconda was installed & the web page was opened and ran without execution
- PHP online examination system version 4.0 source code computer + mobile terminal
- [diy] how to make a personalized radio
- 棋盘左上角到右下角方案数(2)
- 5. Wireless in vivo nano network: top ten "feasible?" problem
- 【DSP】【第一篇】开始DSP学习
- JMeter server resource indicator monitoring (CPU, memory, etc.)
猜你喜欢

“罚点球”小游戏

Design your security architecture OKR

Error analysis ~csdn rebound shell error

OLED屏幕的使用

Anaconda安裝後Jupyter launch 沒反應&網頁打開運行沒執行

Number of schemes from the upper left corner to the lower right corner of the chessboard (2)

数字三角形模型 AcWing 1018. 最低通行费
![Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]](/img/cf/58a62a7134ff5e9f8d2f91aa24c7ac.png)
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]

BeagleBoneBlack 上手记

OAI 5G NR+USRP B210安装搭建
随机推荐
Ideas and methods of system and application monitoring
Recyclerview not call any Adapter method :onCreateViewHolder,onBindViewHolder,
In line elements are transformed into block level elements, and display transformation and implicit transformation
看过很多教程,却依然写不好一个程序,怎么破?
动态切换数据源
Introduction of Xia Zhigang
[DIY]如何制作一款個性的收音機
5. 無線體內納米網:十大“可行嗎?”問題
Design your security architecture OKR
Dynamically switch data sources
[weekly pit] output triangle
8086 instruction code summary (table)
OLED屏幕的使用
OLED屏幕的使用
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
[DIY]如何制作一款个性的收音机
B-jiege's tree (pressed tree DP)
"Penalty kick" games
Unity makes AB package
2110 summary of knowledge points and common problems in redis class