Lists + Functions 4/13 python help


#1

def fizz_count(x):# Write your function below!
count = 0
for item in x:
if x = fizz:
count = count + 1
return count
return fizz


#2

@cloudrunner04788 take a look at the excerpt below

def fizz_count(x):# Write your function below!
    count = 0
    #loop through x for each element
    #we are calling it item
    for item in x:
        #here we want to check if item(the current element)
        # matches "fizz" and not fizz(without quotes)
        #remember that in python this "=" is the assignment
        #operator we use it when we are creating variables
        #but this "==" is the equality(a comparison) operator
        # which is used when we want to check
        #if two things are equal
        if item == "fizz":
            count = count + 1
            
    #Here you want to just return count
    # once you callreturn in a method the method will
    #terminate and anything wriiten in the method
    #after that will not be executed
    return count
    
print fizz_count(["fizz", 'fizz'])

Lists + Functions 4/13 python help
#3

This is for future references.
my code was like this(is in spanish i hope is not problem)
def contar_burbujas(x):
(this is the mistake)
x = ['burbujas', 'random word', 'burbujas', 'random word'](end of the mistake)
contar = 0
for palabra in x:
if palabra == 'burbujas':
contar = contar + 1
return contar
the mistake was that i was declaring the items in the list


#5

def fizz_count(x):# Write your function below!
count = 0
for item in x:
if item == "fizz":
count = count + 1
return count

print fizz_count(["fizz", 'fizz'])