Pointless lambda. Write this instead:
if age > 13:
return 'Welcome to the site!'
return 'Sorry you are too young to enter this site.'
I see a lot of people around here who talk as if lambda isn’t creating a function, which blows my mind, if they’re not aware of that then what do they think they’re doing?
As for backslashes, for most cases you should be using parentheses around the thing you’re splitting up instead.
age_check = (
lambda x: "Welcome to the site!"
if age > 13
else "Sorry you are too young to enter this site."
Which does nothing to excuse using lambda in the first place, use a def statement.
What’s particularly disturbing is the suggestion that a lambda would have something that other function’s don’t, without knowing what that is. You want a function. A function. Input goes in, output goes out.
Also, the argument x isn’t used and there’s an undefined name age.