Python Programming

Are you stressed by poor grades and tight deadlines? We have your back. We can do this or a different assignment for you at an affordable price. Use customdissertations.org writing services to score better and meet your deadlines.


Order a Similar Paper Order a Different Paper

Write a function reverse_words() that takes a message as a list of characters and reverses the order of the words in-place. Why a list of characters instead of a string? The goal of this homewrok is to practice manipulating strings in place. Since we’re modifying the message, we need a mutable type like a list, instead of Python‘s immutable strings.

YOU ARE NOT ALLOWED TO USE THE reverse method; that means, you have to use one or more loops to reverse the list.

For example: message = [ ‘c’, ‘a’, ‘k’, ‘e’, ‘ ‘, ‘p’, ‘o’, ‘u’, ‘n’, ‘d’, ‘ ‘, ‘s’, ‘t’, ‘e’, ‘a’, ‘l’ ]

reverse_words(message)

# Prints: 'steal pound cake'
print ''.join(message)

When writing your function, assume the message contains only letters and spaces,
and all words are separated by one space.

We offer CUSTOM-WRITTEN, CONFIDENTIAL, ORIGINAL, and PRIVATE writing services. Kindly click on the ORDER NOW button to receive an A++ paper from our masters- and PhD writers.

Get a 10% discount on your order using the following coupon code SAVE10


Order a Similar Paper Order a Different Paper