Skip to content

Instantly share code, notes, and snippets.

@edenau
Created January 1, 2020 18:31
Show Gist options
  • Save edenau/275f2514f45b3a5296c4b6fc9396f128 to your computer and use it in GitHub Desktop.
Save edenau/275f2514f45b3a5296c4b6fc9396f128 to your computer and use it in GitHub Desktop.
a = 6
# The following statement
# assigns the value a ** 2 to variable b,
# and then check if b > 0 is true
if (b := a ** 2) > 0:
print(f'The square of {a} is {b}.') # The square of 6 is 36.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment