< Back

Post Lab 18

Post labs are to be done individually. Sharing files between students is not allowed. Doing so is an Academic Integrity violation, and will be treated as such.


One possible way to create a word puzzle is to take the characters of the word, and re-arrange them in some random fashion. This is known as a transposition cipher, and is typically used to create word jumbles that you have likely seen in a newspaper. In this post-lab, you will demonstrate your knowledge of strings by writing a function that can perform a transposition on text.

Details

Write a function called transpose_characters(text), which has one parameter, a string of text. It should return a string with the same letters as the input string but in a random order.

Make sure your program handles all necessary cases gracefully. What additional test cases should you check?

Sample Test Cases

Function Parameters Sample Output
"Scotty" Scytot
"Bouchard" hordcuBa

Submission

Submissions for post labs are to be done via the inquire system. Go to http://inquire.roanoke.edu/ You should see a section for post labs. Submit your .py file to the appropriate post lab location.

Post labs are to be done individually. Sharing files between students is not allowed. Doing so is an Academic Integrity violation, and will be treated as such.