当前位置:网站首页>[question brushing] character statistics [0]
[question brushing] character statistics [0]
2022-07-01 08:04:00 【Si liumishi】
【 Brush problem 】 Character statistics 【0】
One 、 subject
1. Title Description
subject : Give a character set , Please judge the number of different characters
Input : The input line , The length is in 1000 Only lowercase letters are included 、‘{’、‘}’ And Spaces
Output : Output one line , Indicates the number of different letters appearing
Example :
Two 、 Problem solving report
1. Thought analysis
- 1. Replace spaces first
- 2. exclude {}, interfere
- 3. Count
2. Code details
python
a=input()
while(a.find(" ")>0):
a=a.replace(" ","")
b=list(a)
c=[]
d=[',','{','}',]
# print(b)
for i in range(len(b)):
if b[i]!=d[0] and b[i]!=d[1] and b[i]!=d[2]:
c.append(b[i])
# print(c)
e={
}.fromkeys(c).keys()
print(len(e))
边栏推荐
- Missing API interface actual development series (14): ID card real name authentication verification
- 2022.6.30 省赛+蓝桥国赛记录
- [untitled]
- PWN攻防世界int_overflow
- 【网站架构】一招搞定90%的分布式事务,实打实介绍数据库事务、分布式事务的工作原理应用场景
- Microsoft stream - how to modify video subtitles
- Minecraft 1.16.5 module development (51) tile entity
- 0 basic introduction to single chip microcomputer: how to use digital multimeter and precautions
- Vhost kick & call principle
- Aardio - Shadow Gradient Text
猜你喜欢
Gru of RNN
Gui Gui programming (XV) - use scale to control font size changes
三极管是一项伟大的发明
[introduction] approximate value
Principle and process of embossing
Office365 - how to use stream app to watch offline files at any time
Differential: definition of total differential, partial derivative, gradient
良心安利万向轮 SolidWorks模型素材网站
5大组合拳,解决校园6大难题,护航教育信息化建设
The Windows C disk is full
随机推荐
Latex table
php laravel微信支付
【mysql学习笔记27】存储过程
What information does the supplier need to know about Audi EDI project?
How to troubleshoot SharePoint online map network drive failure?
2022.6.30 省赛+蓝桥国赛记录
sqlalchemy创建MySQL_Table
Scala语言学习-07-构造器
How relational databases work
凸印的印刷原理及工艺介绍
力扣每日一题-第31天-202.快乐数
[force deduction 10 days SQL introduction] Day9 control flow
Microsoft stream - how to modify video subtitles
Gdip - hatchBrush图案表
[R language] age sex frequency matching select samples for case-control study, and perform frequency matching on age and sex
Li Kou daily question - day 31 -1502 Judge whether an arithmetic sequence can be formed
TCP/UDP 通信问题整理
2022 test questions and mock examinations for main principals of hazardous chemicals business units
Teach you how to apply for domestic trademark online step by step
Why some people earn nearly 10billion a year, while others earn 3000 a month: the details you ignore actually make the most money