Word

A Word object contains text from a string.

Example Usage

# Create a new Word object.
word = Word('Hello!')

# Store a reversed copy of the word.
reversedWord = word.reverse()

# This prints '!olleH'.
print(reversedWord)

Initialization

Word.Word(self, str)
Parameters:str (string) – the word.
word = Word('Hello')

Getters

Get the string form of the word.

Word.getLetters(self)
word.getLetters()

Methods

Return the reversed form of the word as a string.

Word.reverse(self)
reversedWord = word.reverse()

Table Of Contents