勇敢牛牛,害怕困难
勇敢牛牛,害怕困难
全部文章
分类
工具(1)
题解(17)
归档
标签
去牛客网
登录
/
注册
勇敢牛牛,害怕困难的博客
全部文章
(共16篇)
Python工具| tqdm 制作进度条
from tqdm import tqdm import time for i in tqdm(range(1000)): time.sleep(0.01) 85%|██████████████████████████████████ | 853/1000 [00:10<0...
Python3
2022-01-19
0
376
题解 | #字符个数统计#
题目不难,主要在于ord()函数的使用。'ord'为'ordinal'的缩写,将字符转换为序号(ASCII码)。 while True: try: a = str(input()) s = list(set(a)) res = 0 ...
Python3
字符串
2022-01-06
0
314
题解 | #提取不重复的整数#
字符串2. while True: try: a = int(input()) s = str(a)[::-1] l = [] res = '' for i in s: if i not ...
Python3
2022-01-05
0
271
题解 | #提取不重复的整数#
无脑字符串解题。 while True: try: a = int(input()) s = str(a)[::-1] l = [] for i in s: if i not in l: ...
Python3
字符串
2022-01-05
0
284
题解 | #合并表记录#
两个关键点: 1.判断输入的key值是否已经存在,不存在则创建,存在则相加; 2.sorted()函数对字典按key值进行排序。 while True: try: n = int(input()) dit = {} for i in range...
Python3
数组
2021-12-27
0
300
题解 | #质数因子#
今天有点累了。 import math while True: try: a = int(input()) res = [] for num in range(2,int(math.sqrt(a)+1)): #math.sqrt(a) ...
Python3
2021-12-25
0
259
题解 | #明明的随机数#
注意读题,注意输入形式。 #解法一 #python化解法 两句话解题:用set()去重;用sorted()排序; 注:set是python的“集合”数据类型,集合不包含重复元素;sorted()为python自带函数,用来给集合或列表排序。 #不是喜欢孤独,而是喜欢自由。 while True: ...
Python3
数组
字符串
2021-12-25
0
300
题解 | #计算某字符出现次数#
三句话解题:主要在于大小写的问题。掌握python转大写函数upper()和转小写函数lower()即可轻松解答。这里全转换为大写进行比较。 #For her strength and kind heart. while True: try: a = str(input())...
Python3
字符串
2021-12-25
21
2868
题解 | #进制转换#
另一种字符串暴力解法(记忆力不好易忘记常用函数的人适用):直接创建字典进行检索。 #要大笑,要做梦,要与众不同。人生是一场伟大的冒险🐶。 while True: try: a = input()[2:][::-1] dic = {"A":10,"B":11,...
Python3
2021-12-23
0
405
题解 | #进制转换#
#极简代码#Pythonic# int(a,num)直接转换搞定,num为要转换的进制类型,a为要转化的数字。 #所谓万丈深渊,下去也是前程万里。 while True: try: a = input() print(int(a,16)) except...
Python3
2021-12-23
0
288
首页
上一页
1
2
下一页
末页