![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 65
灸白
这个作者很懒,什么都没留下…
展开
-
字符串练习
字符串练习题1. 去掉字符串中所有的空格# 去掉字符串中所有的空格str = input("请输入一个字符串: ")str = str.strip()list = str.split()print("".join(list))2. 获取字符串中汉字的个数# 获取字符串中汉字的个数a = input("请输入一个字符串: ")count = 0for i in a: if i>= "\u4e00" and i<= "\u9fa5": count+=1print(c原创 2022-07-13 08:46:50 · 369 阅读 · 0 评论 -
Python练习题 判断语句(19-36)
判断语句第十九题set1 = "1\t3\t5\t7\n" \ "9\t11\t13\t15\n" \ "17\t19\t21\t23\n" \ "25\t27\t29\t31\n"set2 = "2\t3\t6\t7\n" \ "10\t11\t14\t15\n" \ "18\t19\t22\t23\n" \ "26\t27\t30\t31\n"set3 = "4\t5\t6\t7\n" \ "12原创 2021-12-02 19:44:55 · 561 阅读 · 0 评论 -
Python练习题 循环语句(37-54)
python练习题原创 2021-12-02 19:26:38 · 602 阅读 · 0 评论