当前位置:网站首页>Openjudge: count the number of numeric characters
Openjudge: count the number of numeric characters
2022-07-28 05:36:00 【Programmer system】
describe
Enter a line of characters , Count out the number of digital characters .
Input
One line string , The total length does not exceed 255.
Output
Output is 1 That's ok , The number of numeric characters in the output string .
The sample input
Peking University is set up at 1898.
Sample output
4
Code 1
s = input()
sum = 0
for i in s:
if '0'<= i <='9':
sum += 1
print(sum)Code 2
s = input()
sum = 0
for i in s:
if i.isdigit():
sum += 1
print(sum)边栏推荐
- Redis 之布隆过滤器
- 24小时内的时间段无交叉
- C language: realize the simple function of address book through structure
- 【idea插件神器】教你如何使用IDEA一键set实体类中所有属性
- Mysql数据库索引(innodb引擎)
- 2022 summer practice (PowerDesigner tutorial learning record) (first week)
- 接口幂等性问题
- Flask Development & get/post request
- 图像增强——MSRCR
- pytorch 计算模型的GFlops和total params的方法
猜你喜欢
随机推荐
[computer level 3 information security] overview of information security assurance
JVM篇 笔记3:类加载与字节码技术
ES6 new variable modifiers let and const, new basic data type symbol
restFul接口使用个人总结
openjudge:找第一个只出现一次的字符
JUC笔记
CentOS7安装MySQL5.7
多系统架构设计思考
JMeter related knowledge sorting
多模块打包:程序包:xxx不存在
openjudge:石头剪刀布
Digital twin technology creates visual application of smart mine
IDEA使用dev-tool实现热部署
What are the methods of array objects in Es5 and what are the new methods in ES6
自定义Json返回数据
openjudge:万年历
集合框架的操作使用
蒙特卡罗方法求解圆周率π并用turtle画点,以及完成进度条问题
Fusiongan code learning (I)
Classes and objects [medium]









