python 提取数字_Python程序以数字的相反顺序提取和打印数字

python 提取数字

Here, we are going to use some mathematical base while programming. The problem is, when you ask a number from the user, the user would give input as multiple digit number (considering integer only). So it is easy to find the type of number but it’s not easy to find the number of digits in the number.

在这里,我们将在编程时使用一些数学基础。 问题是,当您向用户询问数字时,用户会将输入作为多位数字输入(仅考虑整数)。 因此,很容易找到数字的类型,但要找到数字中的数字并不容易。

So, in the following problem, we are going to use the mathematical trick of:

因此,在以下问题中,我们将使用以下数学技巧:

  1. Subtracting the remainder after dividing it by 10 i.e. eliminating the last digit.

    将其除以10后再减去,即消除最后一位。

  2. Dividing an integer by 10 gives up an integer in computer programming (the above statement is only true when the variables are initialized as int only).

    将整数除以10将在计算机编程中放弃整数(仅当变量仅初始化为int时,以上语句才成立)。 </

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值