APT: Bogsquare


filename: Bogsquare.py def score(word): """ return integer obtained by squaring length of String parameter word """

Problem Statement

In some word games the score awarded depends to some extent on the length of the word. For example, in Boggle™ longer words receive higher scores than shorter words.

In the game Bogsquare the score of a word is the square of the length of the word, e.g., "dog" has a score of 9 and "carnivore" has a score of 81.

Write function score to return the score of a string in Bogsquare.



  1. word = "dog"
    returns 9
    3*3 = 9

  2. word = "I"
    returns 1
    One-letter words don't yield a high score.

    word = "Antidisestablishmentarianism" 
    return 784

  4. word = "ox"
    returns 4