工具/原料
- 华硕VivoBook15s
- Windows10
- python3.9.4
方法/步骤
- 1
点击File
打开python编纂器,点击"File"。

- 2
点击New File
点击打开选项中的"New File"。

- 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))

- 4
点击save as
在file选项中点击save as,生存文件。

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

- 6
输入数字
按提醒输入一个三位数的数字。

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







