当前位置:网站首页>【刷题】字符统计【0】
【刷题】字符统计【0】
2022-07-01 07:58:00 【司六米希】
一、题目
1.题目描述
题目:给出一个字符集合,请你判断出现的不同字符个数
输入:输入一行,长度在1000以内仅包括小写字母、‘{’、‘}’ 和空格
输出:输出一行,表示出现的不同字母个数
示例 :
二、解题报告
1.思路分析
- 1.首先将空格取代掉
- 2.排除{},干扰
- 3.计数
2.代码详解
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))
边栏推荐
- Gui Gui programming (XV) - use scale to control font size changes
- PostgreSQL source code learning (26) -- windows vscode remote debugging PostgreSQL on Linux
- Scala语言学习-07-构造器
- Sqlalchemy creating MySQL_ Table
- Why some people earn nearly 10billion a year, while others earn 3000 a month: the details you ignore actually make the most money
- Insufficient executors to build thread pool
- Aardio - [problem] the problem of memory growth during the callback of bass Library
- [getting started] intercepting strings
- Caesar
- PWN攻防世界int_overflow
猜你喜欢
![[batch dos-cmd command - summary and summary] - Common operators in the CMD window (<, < <, & <,>, > >, & >, & >, & &, ||, (),;, @)](/img/48/de19e8cc007b93a027a906d4d423b2.png)
[batch dos-cmd command - summary and summary] - Common operators in the CMD window (<, < <, & <,>, > >, & >, & >, & &, ||, (),;, @)

【入门】输入整型数组和排序标识,对其元素按照升序或降序进行排序

Cyclic neural network

Caesar

Basic knowledge of MATLAB
![[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

PWN攻防世界int_overflow

Day5: scanner object, next() and nextline(), sequential structure, selection structure, circular structure

2022 Guangdong Provincial Safety Officer a certificate third batch (main person in charge) special operation certificate examination question bank simulated examination platform operation

图扑软件通过 CMMI5 级认证!| 国际软件领域高权威高等级认证
随机推荐
【批处理DOS-CMD命令-汇总和小结】-Cmd窗口中常用操作符(<、<<、&<、>、>>、&>、&、&&、||、|、()、;、@)
2022 mobile crane driver test exercises and online simulation test
【mysql学习笔记28】存储函数
【入门】输入n个整数,输出其中最小的k个
Li Kou daily question - day 31 -1502 Judge whether an arithmetic sequence can be formed
ONES 创始人王颖奇对话《财富》(中文版):中国有没有优秀的软件?
Access report realizes subtotal function
The H5 page has set the font thickness style, but the wechat access style in Huawei mobile phone doesn't take effect?
2022 test question bank and simulation test of tea master (primary) operation certificate
LM08丨网格系列之网格反转(精)
力扣每日一题-第31天-1502.判断能否形成等差数列
【mysql学习笔记26】视图
軟鍵盤高度報錯
Latex table
getInputStream() has already been called for this request
Gdip - hatchbrush pattern table
Sqlalchemy creating MySQL_ Table
奥迪AUDI EDI 项目中供应商需要了解哪些信息?
Differential: definition of total differential, partial derivative, gradient
Saving db4i depth camera pictures with MATLAB


