当前位置:网站首页>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)
边栏推荐
- Technology sharing | packet capturing analysis TCP protocol
- Build your own application based on Google's open source tensorflow object detection API video object recognition system (IV)
- 自定义限流注解
- Notes on beagleboneblack
- 2022 refrigeration and air conditioning equipment installation and repair examination contents and new version of refrigeration and air conditioning equipment installation and repair examination quest
- Tencent byte and other big companies interview real questions summary, Netease architects in-depth explanation of Android Development
- 【每周一坑】信息加密 +【解答】正整数分解质因数
- BeagleBoneBlack 上手记
- 【微信小程序】运行机制和更新机制
- 使用.Net驱动Jetson Nano的OLED显示屏
猜你喜欢
Digital triangle model acwing 1018 Minimum toll
Comment faire une radio personnalisée
22-07-05 upload of qiniu cloud storage pictures and user avatars
Anaconda安装后Jupyter launch 没反应&网页打开运行没执行
Web security - payload
数字三角形模型 AcWing 1018. 最低通行费
[cloud native and 5g] micro services support 5g core network
[weekly pit] positive integer factorization prime factor + [solution] calculate the sum of prime numbers within 100
PHP online examination system version 4.0 source code computer + mobile terminal
Basic knowledge of lists
随机推荐
[DIY]如何制作一款个性的收音机
[DIY]自己设计微软MakeCode街机,官方开源软硬件
Jupyter launch didn't respond after Anaconda was installed & the web page was opened and ran without execution
[cloud lesson] EI lesson 47 Mrs offline data analysis - processing OBS data through Flink
使用.Net驱动Jetson Nano的OLED显示屏
Initial experience of addresssanitizer Technology
22-07-05 upload of qiniu cloud storage pictures and user avatars
Continuous test (CT) practical experience sharing
Review questions of anatomy and physiology · VIII blood system
【GET-4】
Unity making plug-ins
【GET-4】
Web security - payload
02 basic introduction - data package expansion
In line elements are transformed into block level elements, and display transformation and implicit transformation
2022 nurse (primary) examination questions and new nurse (primary) examination questions
Function optimization and arrow function of ES6
BUUCTF---Reverse---easyre
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
Technology sharing | packet capturing analysis TCP protocol