【发布时间】:2019-12-04 07:21:23
【问题描述】:
家庭作业:
考虑包含值
Great things never come from comfort zones的字符串's'。确定编号。使用
while循环。将数字存入变量count,并打印出来。
代码:
s="Great things never come from comfort zones"
vowels=["a","e","i","o","u"]
count=0
while chars in s:
if chars in vowels:
count=count+1
我知道如何使用for 循环来解决这个问题,但尝试在while 循环中解决这个问题却出错了。
我认为我在增加 while 循环时犯了一些错误。
【问题讨论】:
-
请把你的代码和回答内容用for循环函数,更容易理解你想要什么或需要什么。
-
它将帮助您处理您的问题URL
标签: python python-3.x