8. Word up


#1



pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word = original.lower()
    first = word[0]
    print word
else:
    print 'empty' 
This is what I input but I keep getting the error: 'Oops, try again. Did you create a variable called word?'

#2

Under your if statement, you say:

It rather should be "print original". I hope this helps!


#3

pyg = 'ay'

original = raw_input('Enter a word:')

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

it is not working


#4

word == original.lower()

Maybe remove one =, so: word = original.lower()

I hope this helps?


#5

my english is poor ,so i do not konw how to explain it .the following are my codes ,and finally they worked.

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:]
print original,first,word,new_word
else:
print 'empty'

good luck!


#6

Hi, did you resolve your problem? I stuck in the same this is my code

pyg = 'ay'

original = raw_input('Enter a word:')

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


#7

pyg = 'ay'

original = raw_input('Enter a word:')

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

Helped when I changed "Print first"


#8

thank you everyone! I figured it out right after I posted this question.


#9

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