当前位置:网站首页>[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))
边栏推荐
- Principle and process of embossing
- 力扣每日一题-第32天-1822.数组元素积的符号
- 【批处理DOS-CMD命令-汇总和小结】-Cmd窗口中常用操作符(<、<<、&<、>、>>、&>、&、&&、||、|、()、;、@)
- [MySQL learning notes 25] SQL statement optimization
- Gui Gui programming (XV) - use scale to control font size changes
- [untitled]
- [MySQL learning notes 28] storage function
- 【入门】输入n个整数,输出其中最小的k个
- 【mysql学习笔记28】存储函数
- What information does the supplier need to know about Audi EDI project?
猜你喜欢

STM32 uses esp01s to go to the cloud, mqtt FX debugging

2022 operation of refrigeration and air conditioning equipment operation of national question bank simulated examination platform
![[batch DOS CMD summary] extension variables - delay variables CMD /v:on, CMD /v:off, SETLOCAL enabledelayedexpansion, disabledelayedexpansion](/img/ce/6c9e4f2c54710610e8b1f68d6d8088.png)
[batch DOS CMD summary] extension variables - delay variables CMD /v:on, CMD /v:off, SETLOCAL enabledelayedexpansion, disabledelayedexpansion

Basic knowledge of MATLAB

Lm08 mesh series mesh inversion (fine)

【Redis】一气呵成,带你了解Redis安装与连接

軟鍵盤高度報錯

Download xshell and xftp

Latex formula code

0 basic introduction to single chip microcomputer: how to use digital multimeter and precautions
随机推荐
Oracle create auto increment ID
Caesar
软件测试方法和技术 - 基础知识概括
Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field
Missing API interface actual development series (14): ID card real name authentication verification
三极管是一项伟大的发明
良心安利万向轮 SolidWorks模型素材网站
How outlook puts together messages with the same discussion
2022 operation of refrigeration and air conditioning equipment operation of national question bank simulated examination platform
matlab保存DB4i深度相机图片
2022.6.30 省赛+蓝桥国赛记录
Kickback -- find the first palindrome character in a group of characters
Significance and measures of source code encryption
Access report realizes subtotal function
【mysql学习笔记27】存储过程
2022 test questions and mock examinations for main principals of hazardous chemicals business units
What information does the supplier need to know about Audi EDI project?
Saving db4i depth camera pictures with MATLAB
The triode is a great invention
Aardio - Shadow Gradient Text


