Question at position 14 What will be the output of the program after the following code fragment is executed? [table] 1 def check_age(age: int):2 if age < 13:3 return 'Child'4 elif age < 20:5 return 'Teenager'6 else:7 return 'Adult'8 9 print(check_age(18))10 print(check_age(10))11 print(check_age(25)) [/table] Teenager Teenager AdultAdultChildAdultChildTeenagerAdultTeenagerChildAdultClear my selection单项选择题
A
Teenager Teenager Adult
B
Adult Child Adult
C
Child Teenager Adult
D
Teenager Child Adult
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
Given year is positive, which expressions for XXX, YYY, and ZZZ will output the correct range? Choices are in the form XXX / YYY / ZZZ. If XXX: Output "1-100" Else If YYY: Output "101-200" Else If ZZZ: Output "201-300" Else: Output "Other"
For the given program, how many cout statements will execute? void PrintShippingCharge(double itemWeight) { if ((itemWeight > 0.0) && (itemWeight <= 10.0)) { cout << (itemWeight * 0.75) << endl; } else if ((itemWeight > 10.0) && (itemWeight <= 15.0)) { cout << (itemWeight * 0.85) << endl; } else if ((itemWeight > 15.0) && (itemWeight <= 20.0)) { cout << (itemWeight * 0.95)<< endl; } } int main() { PrintShippingCharge(18); PrintShippingCharge(6); PrintShippingCharge(25); return 0; }
Given year is positive, which expressions for XXX, YYY, and ZZZ will output the correct range? Choices are in the form XXX / YYY / ZZZ. If XXX: Output "1-100" Else If YYY: Output "101-200" Else If ZZZ: Output "201-300" Else: Output "Other"
What would be the expected result if the value 1.9 was input into Height in the application shown below? Begin Input Height If Height > 1.9 Then Tall ← True Else Tall ← False End If Print Tall End
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!