Skip to content

Instantly share code, notes, and snippets.

@stevencombs
Created August 12, 2013 22:10
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 stevencombs/6215798 to your computer and use it in GitHub Desktop.
Save stevencombs/6215798 to your computer and use it in GitHub Desktop.
# Print every definition in a dictionary
# A Codecademy Python (List + Functions) assignment
# Dr. Steven B. Combs, coding novice
zz = ["fizz","buzz","fizz"] # zz word list
fizz_count(zz) # Pass the zz word list to fizz_count function
def fizz_count(zz): # Defines the fizz_count function
count = 0 # Intialize variable and set to 0
for string in zz: # Step through zz list
if string == "fizz": # If item in list is "fizz"
count += 1 # Add 1 to count
return count # Return the value of count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment