CheckiO
qq_37734886
初学者
展开
-
All Upper:判断字母是否均为大写
https://py.checkio.org/en/mission/all-upper/题目Check if a given string has all symbols in upper case. If the string is empty or doesn’t have any letter in it - function should return True.Input: A string.Output: a boolean.解法upper()函数:将字符串中的小写字母转为大写字原创 2021-01-26 21:49:23 · 220 阅读 · 0 评论 -
Elementary praticing
1.计算数字最后有几个零(1)字符串函数rstrip():删除字符串末尾指定字符def end_zeros(num:int) -> int: return len(s:=str(num))-len(s.rstrip('0'))(2)re.search():使用正则表达式def end_zeros(num:int) -> int: import re return len(re.search('0*$', str(num)).group())2. 字符串转置(1)原创 2021-01-26 21:26:25 · 56 阅读 · 0 评论 -
First-word题目解法
https://py.checkio.org/mission/first-word-simplified/publications/quarkov/python-3/methods-contest/?ordering=most_voted&filtering=all题目You are given a string and you have to find its first word.This is a simplified version of the First Word mission原创 2021-01-05 15:52:07 · 229 阅读 · 0 评论