Please tell me whats wrong


#1

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


#2

nvm mind I got it but it didn't make sense because I had to do something else


#3

In the text editing block, when we are going to post something here in the forum there is a button with the following drawing: "" (without quotes, of course)

Click this button and within the text that will appear when you click the button, paste your code.
This way it is easier to understand your mistake.

Visually you have noticed your mistake.


#5

word = raw_input("Enter ur string :")
if len(word)>0 and word.isalpha():
print "u entered ",word
n=len(word)
word[n]=word[0]
word[0]='ay'
print "pig latin word : ",word
else:
print "cant process" #help me with this pls..


#6

First error: You should use. " ('Enter a word') "

Second error: Two errors in the same line of code. You should use. " if len(original) " and " original.isalpha() "

• Then, you must create the "word" variable and assign it "original" conversion to lowercase letters.

• Then create the variable " first " to store the result of " word [0] ".


#7

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