10/11


#1

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = "Original"
word = word.lower()
first = word[0]
new_word = word + first + pyg
print 'new_word'
new_word =new_word[1:len(new_word)]
s[3]
s[3:6]
second = word[1]
third = word [2]
print 'Original'
else:
print 'empty'
I tried putting original and new_word in the console window, but neither of them worked. How come my code didn't run to end?


#2

you shouldn't use the "" in this case. Because there is a difference between "original" and original. :slightly_smiling:
"original" is a string, the word, written between the ".
original is a variable, in which you can store a value or a string

For example start the programme:
Enter a word: Haha
then the variable word will still be "Original" instead of "Haha", which will give you wrong results :confused:

What you are doing here is -> assign the string "Original" to the variable word, instead of the word, written in

and the second issue is:

you haven't defined s yet, but I think you wanted to write new_word instead, which would be better in this case :smiley:

And don't forget: Words between ' ' or " " are strings (the word written between), and words which don't have ' ' or " " are variables, which you assign or have already assigned and want to use :slightly_smiling: