小编Dav*_*P75的帖子

sum(1 for c in句子 if c.isupper())) 在非编程术语中意味着什么

我需要计算用户输入的句子中大写字母的数量。

当我在 Google 上搜索解决方案时,我遇到了这个命令sum(1 for c in sentence if c.isupper()))

我使用了它并且它有效,但我还需要向我的老师解释代码。

我该怎么做呢?

python string command python-3.x

2
推荐指数
1
解决办法
985
查看次数

标签 统计

command ×1

python ×1

python-3.x ×1

string ×1