Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


I have tried to make a program from 'learn python the hard way'. it's exercise 25. in the extra credit it tells me to go help(ex25), but when I type that in, I get this on linux mint 15 terminal:

bash: syntax error near unexpected token `ex25'

please help. this is my coding:

def break_words(stuff):
    """this function will break-up words for us"""
    words = stuff.split(' ')
    return words

def sort_words(words):
    """sort the words"""
    return sorted(words)

def prints_first_word(words):
    """prints the first word after popping it"""
    word = words.pop (0)
    print word

def print_last_word(words):
    """prints the last word after popping it off"""
    word = words.pop(-1)
    print word

def sort_sentence(sentence):
    """takes in a whole sentence and sorts it"""
    words = break_words(sentence)
    return sort_words(words)

def print_first_and_last(sentence):
    """prints the first and last words of the sentence"""
    words = break_words(sentence)

def print_first_and_last_sorted(sentence):
    """first sorts the words, then prints them"""
    words = sort_sentence(sentence)
share|improve this question
up vote 4 down vote accepted

I quick read through that example at Judging from your post, it sounds like you are typing help(ex25) at the bash prompt, while you should be typing that from within the python interpreter after doing the import ex25 first.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .