Skip to content

Instantly share code, notes, and snippets.

@balu
Last active January 20, 2021 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balu/9f2349d63a393e0f7991830562c97021 to your computer and use it in GitHub Desktop.
Save balu/9f2349d63a393e0f7991830562c97021 to your computer and use it in GitHub Desktop.
  1. Does the following code throw a ZeroDivisionError?
def foo():
    return 1/0
  1. Does the following code throw a ZeroDivisionError?
def const(x):
    return 1

print(const(1/0))
  1. What does this print?
def foo(x, y):
    return x/y

x = 5
y = 2
print(foo(y, x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment