- 博客(2)
- 收藏
- 关注
原创 使用随机函数生成100个点(x, y), -50<=x, y<=50,统计每个象限中点的个数并输出。
import randomquadrant = [[0, ], [0, ], [0, ], [0, ], [0, ]]i = 0while i != 100: a = random.randint(-50, 50) b = random.randint(-50, 50) point = (a, b) i += 1 # print(i) if a > 0 and b > 0: quadrant[1][0] += 1
2021-11-11 13:22:34 1397
原创 Write a Python program to count repeated characters in a string.
利用字典统计并记录字符串中字符出现的个数
2021-11-07 23:57:26 529
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人