Python if len(string) <= 1: how to print the word? @codeacademy

Python if len(string) <= 1: how to print the word? @codeacademy

You are testing the length of the wrong thing. Test original instead:

if len(original) <= 1:
    print original

len(string) is always going to be 6, the number of characters in the value string:

>>> len(string)
6

Python if len(string) <= 1: how to print the word? @codeacademy

Leave a Reply

Your email address will not be published. Required fields are marked *