当前位置:网站首页>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)
边栏推荐
- PowerPivot - DAX (first time)
- Event center parameter transfer, peer component value transfer method, brother component value transfer
- 8086指令码汇总表(表格)
- JVM_ Common [interview questions]
- SSH connection denied
- Core principles of video games
- (工作记录)2020年3月11日至2021年3月15日
- [diy] self designed Microsoft makecode arcade, official open source software and hardware
- Appx code signing Guide
- 5. Wireless in vivo nano network: top ten "feasible?" problem
猜你喜欢

Node. Js: express + MySQL realizes registration, login and identity authentication

强化学习-学习笔记5 | AlphaGo

【每周一坑】输出三角形

Detailed explanation of knowledge map construction process steps
![[network planning] Chapter 3 data link layer (3) channel division medium access control](/img/df/dd84508dfa2449c31d72c808c50dc0.png)
[network planning] Chapter 3 data link layer (3) channel division medium access control

5. Wireless in vivo nano network: top ten "feasible?" problem

Rhcsa Road

rt-thread i2c 使用教程

Case ① | host security construction: best practice of 3 levels and 11 capabilities

OAI 5G NR+USRP B210安装搭建
随机推荐
[weekly pit] output triangle
OLED屏幕的使用
Technology sharing | packet capturing analysis TCP protocol
01 基础入门-概念名词
In unity space, an object moves around a fixed point on the sphere at a fixed speed
OAI 5G NR+USRP B210安装搭建
Extraction rules and test objectives of performance test points
【每周一坑】输出三角形
How to select several hard coded SQL rows- How to select several hardcoded SQL rows?
Logic is a good thing
Function optimization and arrow function of ES6
逻辑是个好东西
Kubernetes learning summary (20) -- what is the relationship between kubernetes and microservices and containers?
持续测试(CT)实战经验分享
使用.Net驱动Jetson Nano的OLED显示屏
Design your security architecture OKR
[DIY]如何制作一款个性的收音机
The mail command is used in combination with the pipeline command statement
Unity writes a timer tool to start timing from the whole point. The format is: 00:00:00
02 基础入门-数据包拓展