Move it on Back


#1

Answer:

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word = original.lower()
    first = word[0]
    new_word = word + first + pyg
    print word
    print first
    print new_word
else:
    print 'empty'

#2

@js_,
in the new-word, word should be presented without it's first-character

new_word = (word - 1st-char) + first + pyg

#3

What exactly should I type in the console to move on. Nothing seems to work?

Move it on Back

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
print original
else:
print 'empty'

word = original
word = original.lower()
first = word[0]

new_word = "word " + "first " + "pyg "


#4

@aigb8046
The result of giving an original "Hello"
would have to be "elloHay"

     ello       H        ay
      |         |        |
    word[1:] + word[0] + pyg

So you will have to slice the string
which is the associated string Value of the variable word
http://stackoverflow.com/questions/1010961/string-slicing-python

And then instead of you concatenating 3 "strings" "word " + "first " + "pyg "
you will have to concatenate the 3 variables word + first + pyg


#5

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word + first + pyg
print first
print word
print new_word
print original
else:
print 'empty'
print first