Module Expr Str Import alias FunctionDef arguments args NameParam NameParam defaults body Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Call AttributeLoad Str attr NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body While NameLoad body Assign NameStore Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr If CompareEq Call NameLoad NameLoad Num body Break Assign NameStore Call NameLoad ListComp Call NameLoad NameLoad comprehension NameStore NameLoad For NameStore Call NameLoad NameLoad body Print BinOpMod Str TupleLoad NameLoad Call AttributeLoad Str attr Call NameLoad NameLoad NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad Print Str
N/A N/A Write a function that randomises letters in words after the first N letters.

It will be called randomWords(words, n) where words is a list of words and n
the number of leading letters of each word to keep in order the remainder are
to be randomly jumbled up.

The code in main will call your function with different values of n to see
how much unscrambled text in each word you need to understand it.

Example:
Words please, <cr> to exit: Numeric is a hedge fund operating out of offices in Boston
   0: imeNucr si a deghe dfnu rntpigeao out of ifosfce in otnBso
   1: Nmuerci is a hedeg fudn oantrgiep out of ofsfcie in Bontos
   2: Nucermi is a heedg fudn opertaign out of ofiscfe in Botson
   3: Numrcei is a hedge fund operantgi out of offseic in Boston
   4: Numeicr is a hedge fund operingat out of offisec in Bostno
   5: Numeric is a hedge fund operaigtn out of offices in Boston
   6: Numeric is a hedge fund operatngi out of offices in Boston
   7: Numeric is a hedge fund operating out of offices in Boston
   8: Numeric is a hedge fund operating out of offices in Boston

So you need about 4 or so letters to understand the sentence.

HINT: The random module is useful, it has a function shuffle(sequence) that
return the sequence randomly shuffled. 

Created on 26 Feb 2015

@author: paulross
 N/A random randomWords N/A N/A words n N/A N/A N/A ret_val N/A N/A word words N/A N/A prefix N/A word N/A n N/A suffix N/A list N/A word N/A n N/A N/A N/A random shuffle suffix N/A N/A N/A ret_val append N/A prefix N/A N/A join suffix N/A ret_val N/A main N/A N/A N/A N/A N/A True N/A N/A line N/A raw_input Words please, <cr> to exit:  N/A words N/A N/A line split N/A N/A N/A len words 0 N/A N/A N/A max_len N/A max N/A N/A len w N/A w words N/A n N/A range max_len N/A N/A N/A %4d: %s N/A n N/A N/A join N/A randomWords words n N/A N/A N/A __name__ __main__ N/A N/A N/A main N/A Bye, bye.