On 5/5/2013 8:59 PM, Bradley Wright wrote:
Hey guys and gals doing this tutorial(codecademy) and needed a bit help from 
the experienced.

I'm writing a function that takes a list(one they supply during runtime)
here's what my function is supposed to do

Do they supply an example so you can test both your comprehension and code? I think most specs given in natural language need such.

1. for each instance of the string "fizz" make a count
2. Finally return that count

Did you create an example problem to test your code? If not, do so.
Did you run your function with example data? If not, do so.

here's my code:

def fizz_cout(x):
     count = 0
     for item in x:
         while item == "fizz":
             count += 1
             return count

Here is hint as to some of what needs to be improved: this function will return either 1 or None. You should have discovered that by testings.

--
Terry Jan Reedy


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to