2025 年 12 月
5 条记录2025 / 12
copilot初体验
copilot初体验
Copilot真的nb,效率高就不说了,额度还多,学生认证的300次高级请求我以为一下子就会用完,没想到我今天一整天的不节制使用才用了不到50%。虽然我一天就用了半个月的量也挺逆天了,但是效率和质量真的搞,今天搞了博客的留言板和阅读进度条,以及主页的日历,真的超级满意:)
2小时之Python入门
2小时之Python入门
哈哈哈哈,重生之我在VSCode被GPT教学Python,光速入门哈哈哈 混了那么久的程序员这个圈子今天才刚开始学编程,下面直接放我2小时的最终成功,是GPT给我题目让我自己动手写的,题目如下:
🎯 练手题目:统计多种字符类型(函数版)
任务:
用户输入一句话
写四个函数:
count_vowels(text) → 返回元音数量
count_numbers(text) → 返回数字数量
count_spaces(text) → 返回空格数量
count_other_letters(text) → 返回除元音以外的字母数量
主程序里调用这四个函数,然后打印结果:
输入一句话:Hello World 123 元音字母数量:3 数字数量:3 空格数量:2 其他字母数量:7
要求:
每个函数用 for + if / elif / else 遍历和判断
每个函数必须用 return 返回结果
主程序只负责调用函数和打印结果
我的答案当然不是一次性写对的,被纠错了两次
最开始我就知道我错了,但是不知道怎么改,初稿如下
python def count_yuanyin(text): yuanyins = ['a', 'e', 'i', 'o', 'u',] yuanyin = 0 for ch in text: f ch in yuanyin: yuanyin += 1 return yuanyin def count_shuzi(text): shuzis = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] shuzi = 0 for ch in text: if ch in shuzis: shuzi += 1 return shuzi def count_kongge(text): kongges = [' '] kongge = 0 for ch in text: if ch in kongges: kongge += 1 return kongge def count_other(text): other = 0 for ch in text: if ch != shuzi and ch != yuanyin and ch !=kongge: other += 1 return other text = input("请输入一段文本:") yuanyin = count_yuanyin(text) shuzi = count_shuzi(text) kongge = count_kongge(text) other = count_other(text) print("元音字母有", yuanyin , "个") print("数字有", shuzi , "个") print("空格有", kongge , "个") print("其他字符有", other , "个")虽然写错了但是感觉也差不多嘛
下面是最终答案
python def count_yuanyin(text): yuanyins = ['a', 'e', 'i', 'o', 'u',] yuanyin = 0 for ch in text: if ch in yuanyins: yuanyin += 1 return yuanyin def count_shuzi(text): shuzis = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] shuzi = 0 for ch in text: if ch in shuzis: shuzi += 1 return shuzi def count_kongge(text): kongges = [' '] kongge = 0 for ch in text: if ch in kongges: kongge += 1 return kongge def count_other(text): shuzis = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] yuanyins = ['a', 'e', 'i', 'o', 'u'] kongges = [' '] other = 0 for ch in text: if ch not in shuzis and ch not in yuanyins and ch not in kongges: other += 1 return other text = input("请输入一段文本:") yuanyin = count_yuanyin(text) shuzi = count_shuzi(text) kongge = count_kongge(text) other = count_other(text) print("元音字母有", yuanyin , "个") print("数字有", shuzi , "个") print("空格有", kongge , "个") print("其他字符有", other , "个")感觉不错(╹ڡ╹ ) 好玩😋😋😋
淘宝闪购真牛逼
淘宝闪购真牛逼
我也不想给淘宝闪购打广告😭😭😭😭,但是他真的好便宜😭😭😭
第一次喝Idrink的水果茶
第一次喝Idrink的水果茶
今天次仁群培请了我一杯吾饮良品的葡萄奶绿水果茶,好喝耶耶耶!
第一次望远镜观月
第一次望远镜观月
今天第一次用天文望远镜赏月,赏的还是超级月亮,本来似乎是说还有流星会掠过月亮能被看见,但是等到10:50还没有,怕被记晚归就回寝室了。但是大部分的人都在10点左右就走光了,只剩三四个人了,因此我也有机会去看看其他的星星。 图5是五车二距离我们42光年,图6,7是天狼星,距离我们9光年,尤其是五车二,我用眼睛都看不见,在手机软件上找准位置才对准拍照的,虽然完全拍不出来哈哈哈哈,毕竟望远镜只有108mm口径,我下回想玩信达小黑😭 对了,晚上是真的冷啊😭😭😭