Jan-21-2021, 11:08 PM
Hello, I'm trying to solve this exercise from the book think python :
Exercise 9.6. Write a function called is_abecedarian that returns True if the letters in a word
appear in alphabetical order (double letters are ok). How many abecedarian words are there?
This is my solution :
Exercise 9.6. Write a function called is_abecedarian that returns True if the letters in a word
appear in alphabetical order (double letters are ok). How many abecedarian words are there?
This is my solution :
def is_abecedarian(w): w = w.lower() if len(w) <= 1 : return True elif ord(w[0]) > ord(w[1]) : return False else : is_abecedarian(w[1:])When I try to run the script it returns None. I don't uderstand why...