Ending Up


#1



https://www.codecademy.com/en/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#


I receive an error message stating that to make sure to set new_word equal to slice as well.


For the program to run smoothly.


 pyg = 'ay'

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


#2

The code is a little awry.

input
validate input
  first letter
  new_word
  assignment of new_word slice
  print new_word
else:
  print "empty"

The pseudo code above indicates the steps.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.