|
________________________
count = 0
def fizz_count(x):
for b in x:
if b == 'fizz':
count + 1
return count
________________________
It's supposed to return the amount of times "fizz" was in:
fizz_count[('fizz','cat','fizz')]
But for some reason it outputs 0
Funification | Was dominusawesomus | you wil cryying when obama take yur computr |Yee | ParanoidHumanoid is my trading account |
|
|
"fizz_count[('fizz','cat','fizz')] "
nah fam you gotta do fizz_count([#stuff])
you can't call the function in list format
Hello, I'm Chandler. I make jokes when I'm uncomfortable. |
|
|
@frog
yeah that's how it was written
i don't write that part, thats just what codecademy used to check my work
Funification | Was dominusawesomus | you wil cryying when obama take yur computr |Yee | ParanoidHumanoid is my trading account |
|
|
I am rather curious, are you asking this question here so you can avoid receiving criticism on the Scripters sub-section? |
|
|
weird
but I think i found the real problem
instead of just putting count + 1
put count += 1
count + 1 doesn't put the modified value back into the variable
Hello, I'm Chandler. I make jokes when I'm uncomfortable. |
|
SlydexiaJoin Date: 2010-08-10 Post Count: 98517 |
"are you asking this question here so you can avoid receiving criticism on the Scripters sub-section"
can ya really blame him if he was? |
|
|
'I am rather curious, are you asking this question here so you can avoid receiving criticism on the Scripters sub-section?'
no it's because I'm an OTer and I'm slightly known (or my older accounts were) so I may be more likely to get help
but kinda
when i go there i am afraid someone who knows like x100 what i do will be mean
just like in real life
Funification | Was dominusawesomus | you wil cryying when obama take yur computr |Yee | ParanoidHumanoid is my trading account |
|
|
"when i go there i am afraid someone who knows like x100 what i do will be mean
just like in real life"
Ah, alright then.
Speaking of "Real-Life", you may benefit from simply signing up on the StackOverflow subsidiary of StackExchange. You will receive plenty of professional, non-aggressive responses on that website. |
|
|
"Speaking of "Real-Life", you may benefit from simply signing up on the StackOverflow subsidiary of StackExchange. You will receive plenty of professional, non-aggressive responses on that website."
nah they'll just close your thread for being "off-topic" or "unclear"
Hello, I'm Chandler. I make jokes when I'm uncomfortable. |
|
|
'nah they'll just close your thread for being "off-topic" or "unclear"'
This will only occur if you do not format your thread properly.
The professionally-qualified individuals cannot help you if you do not specify a relevant issue. |
|
|
yeah im signed up there
Funification | Was dominusawesomus | you wil cryying when obama take yur computr |Yee | ParanoidHumanoid is my trading account |
|