Created
August 12, 2013 22:10
-
-
Save stevencombs/6215798 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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