当前位置:网站首页>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)
边栏推荐
- [DSP] [Part 2] understand c6678 and create project
- Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
- RT thread I2C tutorial
- JMeter server resource indicator monitoring (CPU, memory, etc.)
- Kubernetes learning summary (20) -- what is the relationship between kubernetes and microservices and containers?
- Error analysis ~csdn rebound shell error
- In line elements are transformed into block level elements, and display transformation and implicit transformation
- Review questions of anatomy and physiology · VIII blood system
- Logic is a good thing
- 为什么新手在编程社区提问经常得不到回答,甚至还会被嘲讽?
猜你喜欢
Kubernetes learning summary (20) -- what is the relationship between kubernetes and microservices and containers?
使用.Net驱动Jetson Nano的OLED显示屏
知识图谱之实体对齐二
看过很多教程,却依然写不好一个程序,怎么破?
How does kubernetes support stateful applications through statefulset? (07)
use. Net analysis Net talent challenge participation
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
[wechat applet] operation mechanism and update mechanism
[diy] how to make a personalized radio
OLED屏幕的使用
随机推荐
JS implementation force deduction 71 question simplified path
use. Net drives the OLED display of Jetson nano
[cloud lesson] EI lesson 47 Mrs offline data analysis - processing OBS data through Flink
2110 summary of knowledge points and common problems in redis class
Appx code signing Guide
JVM_ Common [interview questions]
Ideas and methods of system and application monitoring
Application layer of tcp/ip protocol cluster
rt-thread i2c 使用教程
【DSP】【第二篇】了解C6678和创建工程
Logic is a good thing
The mail command is used in combination with the pipeline command statement
Is it difficult for small and micro enterprises to make accounts? Smart accounting gadget quick to use
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
Le lancement du jupyter ne répond pas après l'installation d'Anaconda
[weekly pit] output triangle
Unity writes a timer tool to start timing from the whole point. The format is: 00:00:00
Recyclerview not call any Adapter method :onCreateViewHolder,onBindViewHolder,
深度学习分类网络 -- ZFNet
Force deduction brush question - 98 Validate binary search tree