题目内容

Correct the following codes to count the vowel letters in s.改正下列代码统计字符串s中元音字母的个数。s = 'Life is short, you need Python.'count = 0for c in s:if c.lower() in "aeiou":count++print(count)

查看答案
更多问题

Correct the following codes to count all the input symbols ending with #.改正下列代码统计以#结束的字符个数。count = 0while x=input()!= '#'count += 1print(count)

Correct the following codes to print 9.改正下列代码输出9.x = 0def func():print(x)x = 9func()

There is an error when running the following codes,NameError: name 'r' is not defined. Please correct the error.下列代码运行时错误提示NameError: name 'r' is not defined,请改正其中的错误。import mathclass Circle:def __init__(self, r):self.r = rdef area(self):return math.pi*r*rc = Circle(2)print(c.area())

Correct the following code to print 1.def foo():total += 1return totaltotal = 0print(foo())

答案查题题库