题目详情
单选题 以下哪个代码片段正确地使用了elif
A. if x < 0: print("Negative") if x > 0: print("Positive") else: print("Zero")
B. if x < 0: print("Negative") else if x > 0: print("Positive") else: print("Zero")
C. if x < 0: print("Negative") else if x == 0: print("Zero") else: print("Positive")
D. if x < 0: print("Negative") elif x == 0: print("Zero") else: print("Positive")

学科:Python基础
时间:2025-11-13 08:57:58
相关题目
相关作业
