我是靠谱客的博主 快乐钢笔,这篇文章主要介绍MIT 6.00.1x 笔记,现在分享给大家,希望可以做个参考。

课程第三讲
school = 'Massachusetts Institute of Technology'
numVowels = 0
numCons = 0
for char in school:
if char == 'a' or char == 'e' or char == 'i' 
or char == 'o' or char == 'u':
numVowels += 1
elif char == 'o' or char == 'M':
print char
else:
numCons -= 1
print 'numVowels is: ' + str(numVowels)
print 'numCons is: ' + str(numCons) 
How many times does o print out? Disregard the o's in last two print statements. 
0, if 为True ,就不判断下面的elif else.
What will the value of the variable numVowels be? 
11,大写I没算
What will the value of the variable numCons be? 
-25,加空格。

最后

以上就是快乐钢笔最近收集整理的关于MIT 6.00.1x 笔记的全部内容,更多相关MIT内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(122)

评论列表共有 0 条评论

立即
投稿
返回
顶部