Question #146095

Write a boolean function that returns False if the name has more than 4 letters.

Expert's answer

def check_length(name):
    
    #check the length of the name
    if len(name)>4:
        
        #if it has more than 4 letters, return False 
        return False
    else:
        
        #return True otherwise
        return True

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS