original = raw_input(‘Enter a word:’)

if len(original) > 0 and original.isalpha():
print original
word = original.lower()
first = word[0]
word[0] = word[len(word)]
word[len(word)] = first
print word
print ‘empty’

what i wrote above me is the code, it’s not working


Make sure your code is indented correctly. Python uses white space to recognize structure. If you do not indent your code in an if/else statement, the complier will not recognize it as a conditional. Thus, it will not run your code.


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