python输出百位十位个位

 时间:2026-04-24 20:59:49

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输出百位十位个位

  • python大小写字母转换
  • python创建列表
  • 判断三条边能否构成三角形python实现
  • python统计字符串中字母数字出现的次数
  • python素数判断代码
  • 热门搜索
    枇杷果的功效与作用禁忌 蚕豆的功效与作用 护肤小知识 左旋肉碱什么时候吃 祛湿喝什么茶 cpu在电脑什么位置 历史必修三知识框架 开网店需要什么 运动会图片素材 引号的作用有哪些