Something wrong with the code


I wrote the code:

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
  new_word = new_word [1:len(new_word)]
  print original
  print "empty"

print new_word

But when I try deffrent input I don’t get correct output.


While it does still work, it is generally not a good practice to include whitespace between the identifier and the subscript.


Instead of printing original, print new_word.


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