1.给定一个包含n+1个整数的数组nums,其数字在1到n之间(包含1和n),可知至少存在一个重复的整数,假设只有一个重复的整数,请找出这个重复的数
![](https://img-blog.csdnimg.cn/img_convert/f8bd2bdc528a4113fbeec3b857080f5d.png)
2.找出10000以内能被5或6整除,但不能被两者同时整除的数(函数)
![](https://img-blog.csdnimg.cn/img_convert/125b194a985404e1c8eb31d8243f3461.png)
3.写一个方法,计算列表所有偶数下标元素的和(注意返回值)
![](https://img-blog.csdnimg.cn/img_convert/d4ed06936ae8b5f2d26511afe259a541.png)
4.根据完整的路径从路径中分离文件路径、文件名及扩展名
![](https://img-blog.csdnimg.cn/img_convert/91d3fb6bfdb5e018f9d2342f701745a5.png)
5.根据标点符号对字符串进行分行
![](https://img-blog.csdnimg.cn/img_convert/a07cb6ccb4adfe7774d65c22c1d84c31.png)
6.去掉字符串数组中每个字符串的空格
![](https://img-blog.csdnimg.cn/img_convert/c179182afbcff93f22fa75bbee39e55b.png)
7.随意输入你心中想到的一个书名,然后输出它的字符串长度。(len()属性:可以得字符串的长度)
![](https://img-blog.csdnimg.cn/img_convert/73e4d070a501ced7a6a690529f9a1434.png)
8.两个学员输入各自最喜欢的游戏名称,判断是否一致,如
果相等,则输出你们俩喜欢相同的游戏;如果不相同,则输
出你们俩喜欢不相同的游戏。
![](https://img-blog.csdnimg.cn/img_convert/c13ad5426a7acb585d0df68c5c5963fd.png)
9.上题中两位同学输入 lol和 LOL代表同一游戏,怎么办?
![](https://img-blog.csdnimg.cn/img_convert/ad429c79bb4eb8e1454eb0799f792c88.png)
10.让用户输入一个日期格式如“2008/08/08”,将输入的日
期格式转换为“2008年-8月-8日”。
![](https://img-blog.csdnimg.cn/img_convert/721abc3bcf07683a0db005e06bbd682e.png)
11.接收用户输入的字符串,将其中的字符进行排序(升
序),并以逆序的顺序输出,“cabed”→"abcde"→“edcba”。
![](https://img-blog.csdnimg.cn/img_convert/1b92e23184b702f9d3a07ce7d5c94dcb.png)
12.接收用户输入的一句英文,将其中的单词以反序输
出,“hello c sharp”→“sharp c hello”。
![](https://img-blog.csdnimg.cn/img_convert/81517a5376869a308950e8d82b890079.png)
13.从请求地址中提取出用户名和域名
http://www.163.com?userName=admin&pwd=123456
![](https://img-blog.csdnimg.cn/img_convert/45b041a44b2b44947c649c02a7389c23.png)
14.有个字符串数组,存储了10个书名,书名有长有短,现
在将他们统一处理,若书名长度大于10,则截取长度8的
子串并且最后添加“...”,加一个竖线后输出作者的名字。
![](https://img-blog.csdnimg.cn/img_convert/88d32791e903c7e20055a40d3410d7a8.png)
15.让用户输入一句话,找出所有"呵"的位置。
![](https://img-blog.csdnimg.cn/img_convert/40efd3015bb25c7b381e6fa5debb8e33.png)
16.让用户输入一句话,找出所有"呵呵"的位置。
![](https://img-blog.csdnimg.cn/img_convert/5ffd5f305e25b0e0ae1dffa1155ea0ff.png)
17.让用户输入一句话,判断这句话中有没有邪恶,如果有邪
恶就替换成这种形式然后输出,如:“老牛很邪恶”,输出后变
成”老牛很**”;
![](https://img-blog.csdnimg.cn/img_convert/4d927a59dcece1daa848458b23439ba5.png)
18.如何判断一个字符串是否为另一个字符串的子串
find()
index()
双层循环完成
??
![](https://img-blog.csdnimg.cn/img_convert/23f17f090bfaa282af215972684e035c.png)
19.如何验证一个字符串中的每一个字符均在另一个字符串
中出现过双层循环
![](https://img-blog.csdnimg.cn/img_convert/3cf5144b34189ee60ee034a06107fb10.png)
20.如何随机生成无数字的全字母的字符串
![](https://img-blog.csdnimg.cn/img_convert/298cf5fc5b4044a117349d430a5284e5.png)
21.如何随机生成带数字和字母的字符串
![](https://img-blog.csdnimg.cn/img_convert/2bebac150b013a6a1261009a77e48657.png)
22.如何判定一个字符串中既有数字又有字母
![](https://img-blog.csdnimg.cn/img_convert/6919018b554dda64b6557749accdec8d.png)
23.字符串内的字符排序(只按字母序不论大小写)
![](https://img-blog.csdnimg.cn/img_convert/da78fcebdbd3426a7a94e9b60e8195cf.png)