修正了一处错误注释并添加了计数功能
原程序的注释是“计算学生的平均成绩”但该程序的功能经过运行后可以发现时在终端输出滚动弹幕,于是对注释进行了更改。同时加入了计数器,在执行一段时间之后可以跳出程序的死循环。pull/406/head
parent
eb2cb5f0fc
commit
7b68ad5006
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
输入学生考试成绩计算平均分
|
||||
滚动弹幕
|
||||
|
||||
Version: 0.1
|
||||
Author: 骆昊
|
||||
|
@ -12,12 +12,16 @@ import time
|
|||
|
||||
def main():
|
||||
str = 'Welcome to 1000 Phone Chengdu Campus '
|
||||
counter = 0
|
||||
while True:
|
||||
print(str)
|
||||
counter += 1
|
||||
time.sleep(0.2)
|
||||
str = str[1:] + str[0:1]
|
||||
# for Windows use os.system('cls') instead
|
||||
os.system('clear')
|
||||
if counter == 100:
|
||||
break
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue