Skip to content

Instantly share code, notes, and snippets.

@pschanely
Created October 11, 2024 21:38
Show Gist options
  • Save pschanely/3c5dc5865f809d4e3cad775959649c49 to your computer and use it in GitHub Desktop.
Save pschanely/3c5dc5865f809d4e3cad775959649c49 to your computer and use it in GitHub Desktop.
Shared via CrossHair Playground
def f1(n: int) -> int:
return (n % 2) == 0
def f2(n: int) -> int:
if (n == 1000):
return 0
else:
return (n & 1) == 0
def equivalent(n: int) -> bool:
'''
pre: n >= 0
post: __return__
'''
return f1(n) == f2(n)
def different(n: int) -> bool:
'''
pre: n >= 0
post: __return__
'''
return f1(n) != f2(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment