how to return a result of an argument that satisfies a condition without having to rewrite the argument in the return function.
e.g. (Long method)
if a+b > c:
return a+b
is there a shorter syntax in the likes of-
if a+b > c
return ans
(where in this case ans == a+b)
usually, the argument is much more complex than just a + b so it would save a lot of trouble retyping the entire argument
Aucun commentaire:
Enregistrer un commentaire