A Very Simple Name Manipulation Script in Python

Started the MIT Intro MOOC, whose material should be a breeze for me.  Going to do it with some coworkers.

Best way to learn constantly told is to play around with programs and just figure it out.  Googling things to add; and just thinking through other ways to build stuff.  I couldn’t (quickly) figure out how to add color to the printout (duh, can I not install packages yet properly?)

In that spirit, a really simple text manipulation script.

# a way to play with strings

import time

name = raw_input(‘Enter a name for me to mess with: ‘)
times = 1

print ” “+name[::-1]

for character in name:

print character + ” “*len(name)+ name[-times] # had done ‘character[-1]’
times += 1

print ” “+name



This generates, with a slight delay (in the ‘sleep’ argument):



Leave a Reply