def new_if (pred,then_clause,else_clause):
if pred:
then_clause
else:
else_clause
def p(x):
new_if(x>5,print(x),p(2*x))
p(1)
I think the function should stop once x reaches 8 and 8 is printed out.
Thanks a lot for helping
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…