题目
题目

CSE-20-01 Practice Midterm

单项选择题

Which input value causes "Goodbye" to be output next? x = int(input()) while x >= 0: # Do something x = int(input()) print('Goodbye')

选项
A.0
B.1
C.-1
D.No such value
查看解析

查看解析

标准答案
Please login to view
思路分析
Consider how the loop in the code operates. The line x = int(input()) reads the first value, and the loop condition is while x >= 0. This means the loop body only runs if the current x is at least 0; otherwise, the program skips the loop and immediately executes print('Goodbye'). Optio......Login to view full explanation

登录即可查看完整答案

我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!