Help with lists and fucntions?

A forum for general discussion of the Python programming language.

Help with lists and fucntions?

Postby murster972 » Sun Sep 08, 2013 8:54 am

im learning python using codecademy, and got stuck on this?

these are the instructions:
Write a function called fizz_count that takes a list x as input and returns the count of the string “fizz” in that list.

For example, fizz_count(["fizz","buzz","fizz"]) should return 2. (Make sure your function returns the number instead of printing it.) Check out the Hint if you need help!

i know how to define the function, but am stuck after that?
Posts: 20
Joined: Fri Jul 19, 2013 8:54 pm

Re: Help with lists and fucntions?

Postby hansn » Sun Sep 08, 2013 9:30 am

I would love to help, but I would really like to see you make an effort first.

In codeacademy, step back to where you first learned about functions, study the material, try and solve the problem, then show us what you've tried :)

edit: I realize you might understand how functions work and actually need help performing operations on the list. I would still prefer that you study the codeacademy material and make an effort. That way I can point you in the right direction in stead of giving you the answer directly.
Posts: 87
Joined: Thu Feb 21, 2013 8:46 pm

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 2 guests