下面if语句统计满足“性别(gender)为男、职称(rank)为教授、年龄(age)小于40岁”条件的人数,正确的语句为( )。
(A)if (gender == "男" or age < 40 and rank == "教授"): n+=1
(B)if (gender =="男" and age<40 and rank=="教授"): n+=1
(C)if (gender =="男" and age<40 or rank=="教授"): n+=1
(D)if (gender =="男" or age<40 or rank=="教授"): n+=1
参考答案
继续答题:下一题