手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

python输出百位十位个位

时间:2024-10-12 16:37:41

1、点击File打开python编辑器,点击“File”。

python输出百位十位个位

2、点击New File点击打开选项中的“New File”。

python输出百位十位个位

3、输入代码number = int(input('请输入一个三位数:'))a = number%10 #个位b = number//10鬈熵痼霄%10 #十位c = number//100 #百位print('%d的百位是:%d'%(number,c))print('%d的十位是:%d'%(number,b))print('%d的个位是:%d'%(number,a))

python输出百位十位个位

4、点击save as在file选项中点击save as,保存文件。

python输出百位十位个位

5、运行代码在run选项中点击run module运行代码。

python输出百位十位个位

6、输入数字按提示输入一个三位数的数字。

python输出百位十位个位

7、得出结果按回车键即可输出这个三位数的个位、十位和百位数字。

python输出百位十位个位
© 手抄报圈