Task is achieved but error still pops up



this is the error message : Oops, try again. first should contain the first letter of word.

original = raw_input('Enter a word:')
new_word=s + word + first
if len (new_word) > 0 and new_word.isalpha():
    print s[0]
    print s[1:4]
    print 'empty'


If you read your code you'll find that you're doing things out of order
Also, what's special about the string "Charlie"? If you refer to the description of what your code should be doing, I don't think it'll say anything about that particular string


fair enough, im going to re do it. thanks tho


I'd suggest fixing it instead. A start would be to read it and manually execute it - that way you'll encounter the same things and you can compare to what's supposed to happen. Of course, you'll probably want to read over the instructions again to make sure you know what is supposed to happen


thanks for the advice


hi ionatan

i have been trying to figure it out but i managed to slice it but for some reason i cant understand where to include the [1:len(new_world)], could you please hint me thanks

link to my task

original = raw_input('Enter a word:')
new_word= first+sec
if len (new_word) > 0 and new_word.isalpha():
print new_word
print 'empty'


Try figuring out how slicing behaves first and what the syntax is - with that you can refer to what the desired effect is and work out how where to put that. If what the instructions describe isn't enough, then go search for other resources, for example this https://stackoverflow.com/questions/509211/explain-pythons-slice-notation

Note that you are already using slicing in your code, and it seems oddly specific too, where does the number 4 come from? You need to motivate why each thing is correct, if you can't, then keep finding out more about that something, read about it or experiment with it with simpler usage with no other code


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