Skip to content

Instantly share code, notes, and snippets.

@pamelafox
Created August 30, 2021 06:31
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 pamelafox/3de892f8a8bc810d127783c6e7851287 to your computer and use it in GitHub Desktop.
Save pamelafox/3de892f8a8bc810d127783c6e7851287 to your computer and use it in GitHub Desktop.
Count Evens
"""Write a function that will count the number of even numbers between a given start number and a given end number.
It should include the start or end if they are even.
"""
def count_evens(start, end):
"""
>>> count_evens(2, 2)
1
>>> count_evens(-2, 52)
28
>>> count_evens(237, 500)
132
"""
# YOUR CODE HERE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment