Revision: 56539
Updated Code
at April 14, 2012 12:30 by jdsantiagojr
Updated Code
#------------------------------------------------------------------------------- # Name: Backwards message # Purpose: Prints message entered by user backwards using string # slicing or list() function # # Author: John Santiago Jr. # # Created: 03/04/2012 #------------------------------------------------------------------------------- def message_lst(): message = input('Enter Message: ') new_message = list(message) new_message.reverse() print('Your message backwards is:') print(''.join(new_message)) def message_str(): message = input('Enter Message: ') new_message = '' while message: new_message += message[-1] message = message[:-1] print('Your message backwards is:') print(new_message)
Revision: 56538
Updated Code
at April 3, 2012 12:12 by jdsantiagojr
Updated Code
#------------------------------------------------------------------------------- # Name: Backwards message # Purpose: Prints message entered by user backwards using string # slicing or list() function # # Author: John Santiago Jr. # # Created: 03/04/2012 #------------------------------------------------------------------------------- def message_lst(): message = input('Enter Message: ') new_message = list(message) print('Your message backwards is:') print(''.join(reversed(new_message))) def message_str(): message = input('Enter Message: ') new_message = '' while message: new_message += message[-1] message = message[:-1] print('Your message backwards is:') print(new_message)
Revision: 56537
Updated Code
at April 3, 2012 12:06 by jdsantiagojr
Updated Code
#------------------------------------------------------------------------------- # Name: Backwards message # Purpose: Prints message entered by user backwards using string # slicing or list() function # # Author: John Santiago Jr. # # Created: 03/04/2012 #------------------------------------------------------------------------------- def message_lst(): message = input('Enter Message: ') new_message = list(message) print('Your message backwards is:') print(''.join(reversed(new_message))) def message_str(): message = input('Enter Message: ') while message: new_message += message[-1] message = message[:-1] print('Your message backwards is:') print(new_message)
Revision: 56536
Updated Code
at April 3, 2012 12:05 by jdsantiagojr
Updated Code
#------------------------------------------------------------------------------- # Name: Backwards message # Purpose: Prints message enterd by user backwards using string # slicing or list() function # # Author: John Santiago Jr. # # Created: 03/04/2012 #------------------------------------------------------------------------------- def message_lst(): message = input('Enter Message: ') new_message = list(message) print('Your message backwards is:') print(''.join(reversed(new_message))) def message_str(): message = input('Enter Message: ') while message: new_message += message[-1] message = message[:-1] print('Your message backwards is:') print(new_message)
Revision: 56535
Updated Code
at April 3, 2012 12:01 by jdsantiagojr
Updated Code
#------------------------------------------------------------------------------- # Name: Backwards message # Purpose: Prints message enterd by user backwards using string # slicing or list() function # # Author: John Santiago Jr. # # Created: 03/04/2012 #------------------------------------------------------------------------------- def message_lst(): message = input('Enter Message: ') new_message = list(message) print(''.join(reversed(new_message))) def message_str(): message = input('Enter Message: ') while message: new_message += message[-1] message = message[:-1] print('Your message backwards is:') print(new_message)
Revision: 56534
Updated Code
at April 2, 2012 18:20 by jdsantiagojr
Updated Code
# Backwards Message # # User enters message and program prints it out backwards message = input('Enter message: ') new_message = '' while message: new_message += message[-1] message = message[:-1] print('Your message backwards is:') print(new_message) input('\n\nPress enter key to exit.')
Revision: 56533
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 2, 2012 18:18 by jdsantiagojr
Initial Code
# Backwards Message # # User enters message and program returns the message backwards message = input('Enter message: ') new_message = '' while message: new_message += message[-1] message = message[:-1] print('Your message backwards is:') print(new_message) input('\n\nPress enter key to exit.')
Initial URL
Initial Description
Two ways of printing a message backwards using either string slicing, or list() function.
Initial Title
Backwards Message
Initial Tags
python, 3
Initial Language
Python