Your car is old, it breaks easily. The shock absorbers are gone and you think it can handle about 15 more bumps before it dies totally.

Unfortunately for you, your drive is very bumpy! Given a string showing either flat road ("\_") or bumps ("n"), work out if you make it home safely. 15 bumps or under, return "Woohoo!", over 15 bumps return "Car Dead".

Difficulty: introductory

Starter code:

def bumps(road):
	

Solutions:
def bumps(road):
    return "Woohoo!" if road.count("n") <= 15 else "Car Dead"

def bumps(road):
    return 'Car Dead' if road.count('n')>15 else 'Woohoo!'

def bumps(road):
    return "Woohoo!" if road.count('n')<16 else "Car Dead"

from collections import Counter


def bumps(road):
    return "Car Dead" if Counter(road)['n'] > 15 else "Woohoo!"


import re
def bumps(road):
    return "Woohoo!" if len(re.findall("n", road)) < 16 else "Car Dead"

def bumps(road):
    MAX_BUMPS = 15
    SUCCESS_MESSAGE = 'Woohoo!'
    ERROR_MESSAGE = 'Car Dead'
    
    return SUCCESS_MESSAGE if road.count('n') <= MAX_BUMPS else ERROR_MESSAGE

def bumps(road):
    if road.count('n') < 16:
        return "Woohoo!"
    return "Car Dead"

def bumps(road):
    if road.count('n') > 15:
        return "Car Dead"
    else:
        return "Woohoo!"

bumps=lambda road: 'CWaoro hDoeoa!d'[(road.count('n')<16)::2]

def bumps(road):
   return ("Woohoo!", "Car Dead")[road.count('n') > 15]

def bumps(road):
    
    track = 0
    
    for el in road:
        if el == 'n':
            track += 1
    
    if track > 15:
        return 'Car Dead'
    else:
        return 'Woohoo!'

def bumps(road):
    n = 'n'
    return 'Woohoo!' if road.count(n) <= 15 else 'Car Dead'


def bumps(road):
    a = 0
    
    for i in road:
        if i == 'n':
            a += 1
            
    if a > 15:
        return 'Car Dead'
    else:
        return 'Woohoo!'
        


def bumps(road):
    bumps = 0
    for c in road:
        if c == "n":
            bumps += 1
    if bumps <= 15:
        return "Woohoo!"
    else: return "Car Dead"

def bumps(road):
    L = list(road)
    C = L.count('n')
    if C > 15:
        return 'Car Dead'
    else:
        return 'Woohoo!'


def bumps(road):
    r = list(road)
    
    if r.count('n') <=15:
        return "Woohoo!"
    else:
        return "Car Dead"



def bumps(road):
    #I: string
    #O: string
    
    #
    commute = road 
    
    #count bumps
    bumps = commute.count('n')
    
    #summarize filter logic
    condition_1 = bumps < 16
    condition_2 = bumps >= 16 
    
    if condition_1:
        return 'Woohoo!'
    if condition_2:
        return 'Car Dead'
    
    


def bumps(road):
    count = 0
    for el in road:
        if el == "n":
            count+=1
    if count <= 15:
        return "Woohoo!"
    else:
        return "Car Dead"





def bumps(road):
    return 'Car Dead' if len([r for r in road if r is 'n']) > 15 else 'Woohoo!'


def best_practice_bumps(road):
    return "Woohoo!" if road.count("n") <= 15 else "Car Dead"




def bumps(road):
    road.count('n')
    if road.count('n') <= 15:
        return "Woohoo!"
    elif road.count('n') > 15:
        return  "Car Dead"
    else:
        pass


def bumps(road):
    x = road.count("n")
    results = ["Woohoo!", "Car Dead"]
    
    if x > 15:
        return results[1]
    else:
        return results[0]

def bumps(road):
    c = road.count("n")
    if c > 15:
        return "Car Dead"
    return "Woohoo!"

def bumps(road):
    bumps= road.count("n")
    if bumps > 15:
        return "Car Dead"
    elif bumps <= 15:
        return "Woohoo!"
        


def bumps(road):
    k = list(road)
    count = 0
    for word in k:
        if word == "n":
            count += 1
    if count < 16:
        return "Woohoo!"
    else :
        return "Car Dead"


def bumps(road):
    b = road.count('n')
    if b<=15:
        return 'Woohoo!'
    else:
        return 'Car Dead'

def bumps(s):
    return 'Woohoo!' if s.count('n') < 16 else 'Car Dead'

def bumps(road):
    bumps = 0
    
    for char in road:
        if char == 'n':
            bumps = bumps + 1
    if bumps <= 15:
        return 'Woohoo!'
    else: return 'Car Dead'

def bumps(road):
    n = 0
    for i in road:
       if i=="n":
          n = n+1
    return ("Woohoo!" if n<=15 else "Car Dead" )


def bumps(road):
    b = road.count('n')
    if b > 15:
        s = "Car Dead"
    else:
        s = "Woohoo!"
    return s

def bumps(road):

    count = 0
    for i in road:
        if i == "n":
            count += 1
    
    if count <= 15:
        return "Woohoo!"
    return "Car Dead"

def bumps(road):
    counter = 0
    for i in road:
        if i == 'n':
            counter += 1
    if counter > 15:
        return 'Car Dead'
    else:
        return 'Woohoo!'

def bumps(road):
    if road.count('n') <= 15:
        return "Woohoo!"
    return "Car Dead"
    # Flez


def bumps(road):
    bumps = [x for x in road if x == 'n']
    if len(bumps) > 15:
        return 'Car Dead'
    return 'Woohoo!'

def bumps(road: str) -> str:
    return "Car Dead" if road.count('n') > 15 else "Woohoo!"


bumps = lambda s: 'Woohoo!' if s.count('n') < 16 else 'Car Dead'

def bumps(road):
    x=0
    for i in road:
        if i=="n":
            x+=1
    if x>15:
        return "Car Dead"
    else:
        return "Woohoo!"
    # your code here


def bumps(road):
    n = 0
    for i in road:
        if i == 'n':
            n += 1
    if n > 15:
        return "Car Dead"
    return "Woohoo!"    

def bumps(road):
    # your code here
    n = road.count("n")
    if n <= 15:
        return "Woohoo!"
    return "Car Dead"

def bumps(road):
    count = 0
    for char in road:
        if char == "n":
            count += 1
    if count > 15:
        return "Car Dead"
    else:
        return "Woohoo!"

def bumps(road):
    list(road)
    bump_counter = 0
    for bump in road:
        if bump == 'n':
            bump_counter += 1
    if bump_counter <= 15:
        return "Woohoo!"
    else:
        return "Car Dead"

def bumps(road):
    counter = -1
    bumps = 0
    for x in road:
        counter += 1
        if road[counter] == 'n':
            bumps += 1
            print(bumps)
    if bumps <= 15:
        return 'Woohoo!'
    else:
        return 'Car Dead'


def bumps(road):
    a = 0
    for i in road:
        if i == "n":
            a += 1
            if a > 15:
                return "Car Dead"
    return  "Woohoo!"

def bumps(road):
    n = 0
    for char in road:
        if char == "n":
            n += 1
    if n > 15:
        return "Car Dead"
    else: return "Woohoo!"

def bumps(road):
    # your code here
    bumps = 0
    for i in range(len(road)):
        if road[i] == "n":
            bumps += 1
        if bumps > 15:
            return "Car Dead"
    
    return "Woohoo!"

def bumps(s):
  return("Woohoo!" if s.count('n') <= 15 else "Car Dead")

def bumps(road):
    count = 0
    for x in road:
        if x is "n":
            count = count + 1
    if count > 15: x = "Car Dead"
    else: x = "Woohoo!"
    return x

def bumps(road):
    fiut=0
    for n in road:
        if n == "n":
            fiut += 1
    if fiut>15:
        return "Car Dead"
    else:
        return "Woohoo!"

def bumps(road):
    count = 0
    for c in road:
        if c == 'n':
            if count == 15:
                return "Car Dead"
            count += 1
    return "Woohoo!"

def bumps(road):
    
    
    c = road.count('n')
    
    if c>15:
    
        return "Car Dead"
        
    else:
    
        return "Woohoo!"
        


def bumps(road):
    x = 0
    for spot in road:
        if spot == 'n':
            x += 1
        else:
            continue
    if x > 15:
        return "Car Dead"
    else:
        return "Woohoo!"


def bumps( road ):
    cnt1, cnt2 = 0, 0
    for c in road:
        if c == "_":
            cnt1 += 1
        elif c == "n":
            cnt2 += 1
        if cnt2 > 15:
            return "Car Dead"
    return "Woohoo!"


f1 = lambda x: 1 if x == 'n' else 0
f2 = lambda x: 'Woohoo!' if x <= 15 else "Car Dead"

def bumps(road):
    # your code here
    return f2(sum((f1(x) for x in road)))

def bumps(road):
    ncount = 0
    a = [char for char in road]
    for i in range(len(a)):
        if a[i] == "n":
            ncount += 1
            
    if ncount > 15:
        return "Car Dead"
    else:    
        return "Woohoo!"

def bumps(road):
    flat=[]
    bump=[]
    for letter in road:
        if letter is "_":
          flat.append(letter)
        else:
          bump.append(letter)
    if len(bump)<=15:
        return "Woohoo!"
    else:
        return "Car Dead"


def bumps(s):
    if s.count("n") <= 15:
        return "Woohoo!" 
    else:
        return "Car Dead"


def bumps(road):
    bumps = 0
    for letter in road:
        if letter == 'n' or letter == 'N':
            bumps += 1
        elif letter == '_':
            continue
        else:
            continue
    if bumps > 15:
        return 'Car Dead'
    else:
        return 'Woohoo!'

def bumps(road):
    bumps = 0
    for letter in road:
        if letter == 'n':
            bumps += 1
            continue
        else:
            continue
    if bumps > 15:
        return 'Car Dead'
    else:
        return 'Woohoo!'

def bumps(road):
    result = 0
    for i in road:
        if i == "n":
            result +=1
    if result <= 15:
        return "Woohoo!"
    else:
        return "Car Dead"

def bumps(road):
    nr_bumps = 0
    for c in road:
        if c == 'n':
            nr_bumps += 1
    return "Woohoo!" if nr_bumps < 16 else "Car Dead"

def bumps(road):
   x = road.count('n')
   if x <= 15:
        return 'Woohoo!'
   else :
        return 'Car Dead'

def bumps(road):
    a = 0
    for char in road:
        if str(char) == 'n':
            a += 1
    if a <= 15:
        return 'Woohoo!'
    if a > 15:
        return 'Car Dead'

def bumps(road):
    n=0
    for i in road:
        if i=="n":
            n+=1
    if n>15:
        return "Car Dead"
    else:
        return "Woohoo!"

def bumps(road):
    counter = 0
    for i in road:
        if i == 'n':
            counter += 1
            continue
    return 'Woohoo!' if counter <= 15 else 'Car Dead'


def bumps(road):
    bumps = 0
    for a in road:
        if a == 'n':
            bumps += 1
    if bumps <= 15:
        return "Woohoo!"
    else:
        return "Car Dead"

def bumps(road):
    return 'Car Dead' if (''.join(sorted(road, reverse=True)[0:16]))=='nnnnnnnnnnnnnnnn' else 'Woohoo!'

def bumps(road):
    x = road.count("n")
    if x <= 15:
        return "Woohoo!"
    return "Car Dead"

def bumps(road):
    count  = 0
    for i in road:
        if i == 'n':
            count += 1
        else:
            pass
    if count > 15:
        return ("Car Dead")
    else:
        return ("Woohoo!")
        


def bumps(road):
  roadList = list(road)
  speedBumps = "n"
  bumpCount = 0
  for i in roadList:
      if i == "n":
        bumpCount += 1
  if bumpCount > 15:
      return "Car Dead"
  else:
      return "Woohoo!"

def bumps(road):
    return "Woohoo!" if len(list(filter((lambda x: x == 'n'), road))) <= 15 else "Car Dead"

def bumps(road):
    l = 0
    for i in road:
        if i == "n":
            l += 1
    return "Woohoo!" if l <= 15 else "Car Dead"

def bumps(road):
    list = [(road)]
    a = 0
    for x in road:
        if x == 'n':
            a = a + 1
    if a > 15:
        return "Car Dead"
    return "Woohoo!"        

def bumps(road):
    bump = 15
    for char in road:
        if char == 'n':
            bump = bump - 1
    return "Car Dead" if bump < 0 else "Woohoo!"

def bumps(road):
    bumps = 0
    for char in road:
        if char == 'n':
            bumps += 1
    if bumps > 15:
        return "Car Dead"
    else:
        return "Woohoo!"

def bumps(road):
    countN=0
    countUnderscore=0
    listletters=[char for char in road]
    for i in listletters:
        if i=='n':
            countN+=1
        else:
            countUnderscore+=1
    if countN>15:
        return "Car Dead"
    else:
        return "Woohoo!"

def bumps(road):
    # your code here
    bump = 0
    for s in road:
        if s == 'n':
            bump+=1
    return "Woohoo!" if bump<=15 else "Car Dead"

def bumps(road):
    r = road
    c = r.count("n")
    if c < 16:
        return "Woohoo!"
    else:
        return "Car Dead"

def bumps(road):
    # your code here
    return "Car Dead" if len(list(filter(str.isalpha,road))) > 15 else 'Woohoo!'    


def bumps(road):
    # your code here
    bumps = 0
    for i in road:
        if i == '_':
            pass
        elif i == 'n':
            bumps += 1
    if bumps > 15:
        return "Car Dead"
    else:
        return "Woohoo!"

def bumps(road):
    dead = 0
    for x in road:
        if x == "n":
            dead += 1
            
    if dead > 15:
        return "Car Dead"
    else:
        return "Woohoo!"

def bumps(road):
    counter=0
    for i in road:
        if i=='n':
            counter+=1
        else:
            pass
    return 'Woohoo!'if counter<=15 else 'Car Dead'
        


def bumps(road):
    bumps = 0
    for ch in road:
        if ch == "n":
            bumps +=1
    
    if bumps > 15:
        return "Car Dead"
    else:
        return "Woohoo!"

def bumps(road):
    num=0
    for x in road:
        if x == 'n':
            num+=1
    if num <= 15:
        return 'Woohoo!'
    else:
        return 'Car Dead'

def bumps(road):
    bumps = 0
    for i in range(len(road)):
        if road[i] == "n":
            bumps = bumps + 1
            
    if bumps > 15:
        return "Car Dead"
    else:
        return "Woohoo!"

def bumps(road):
    count = 0
    for each in road:
        if each == "n":
            count += 1
    if count > 15:
        return "Car Dead"
    elif count <= 15:
        return "Woohoo!"

def bumps(road):
    x = road.count('n',0)
    if x <= 15:
        return 'Woohoo!'
    else:
        return 'Car Dead'


def bumps(road):
#    for i in road:
    c = road.count("n")
    if c > 15:
        return "Car Dead"
    else:
        return "Woohoo!"
   # for i in bumps:
    
    # your code here


def bumps(road):
    # your code here
    road_list = list(road)
    bump_number = 0
    for segment in road_list:
        if segment == 'n':
            bump_number += 1
    if bump_number <= 15:
        return "Woohoo!"
    else:
        return "Car Dead"

def bumps(road):
    n = [x for x in road if x == 'n'].count('n')
    return 'Woohoo!' if n <= 15 else 'Car Dead'

def bumps(road):
    sum = 0
    for i in road:
        if i is "n":
            sum += 1
        if sum > 15:
            return "Car Dead"
    return "Woohoo!"

def bumps(road):
    return 'Woohoo!' if len(road.split('n')) <= 16 else 'Car Dead'

def bumps(road):
    newrd = list(road)
    bumps = newrd.count('n')
    if bumps <= 15:
        return "Woohoo!"
    elif bumps > 15:
        return "Car Dead"
       


def bumps(road):
    b = 0
    for i in road:
        if i == 'n':
            b+=1
    return "Woohoo!" if b <= 15 else "Car Dead"

def bumps(road):
    count = road.count("n")
    if count > 15:
        return "Car Dead" 
    return "Woohoo!"


bumps = lambda road: "Woohoo!" if road.count('n')<16 else "Car Dead"


def bumps(road):
    b=0
    for x in road:
        if x == 'n':
            b = b+1
    if b<15:
        return "Woohoo!"
    elif b==15:
        return "Woohoo!"
    else:
        return "Car Dead"


def bumps(road):
    n_count = road.count("n")
    
    if n_count > 15:
        return "Car Dead"
    elif n_count <= 15:
        return "Woohoo!"
    return


def bumps(road):
    '''(string)-> string
    A string representation of the road will be the input.
    Tests will be made to ensure that there are less than 15
    bumps in the road.'''
    num_bumps = road.count('n')
    if num_bumps > 15:
        return 'Car Dead'
    return 'Woohoo!'


def bumps(road):
    bump = 0
    for x in road:
        if x == "n":
            bump += 1
    if bump <= 15:
        return("Woohoo!")
    else:
        return("Car Dead")

def bumps(road):
    badNumber = 15
    count = 0
    for i in range(len(road)):
        if road[i] == "n":
            count += 1
    if count <= badNumber:
        return "Woohoo!"
    if count > badNumber:
        return "Car Dead"

def bumps(road):
    lista = list(road)
    bumps = 0
    for i in lista:
        if i == 'n':
            bumps += 1
    
    if bumps <= 15:
        return 'Woohoo!'
    else:
        return 'Car Dead'