10. Ending Up


#1



https://www.codecademy.com/en/courses/python-beginner-2W5v7/1/4?curriculum_id=4f89dab3d788890003000096#


When I type in python, it prints pythonpythonay and at the bottom of the page it says-
It looks like new_word contains "pythonpythonay" instead of "ythonpay"!


It should say ythonpay


original = raw_input('Enter a word:')
new_word = word + first + original[1:] + pyg
word = original.lower()
first = word[0]
pyg = 'ay'

if len(original) > 0 and original.isalpha():
    print new_word
else:
    print 'empty'


#2

It is vital that we recognize how important ordering is. Instructions are given that take us through the steps, but this assumes we will continue down the page, not pile code on top of what we started with.

Suggest reset the exercise and start from the beginning, taking care to build downwards, not upwards so the order is correct. Most of the pieces are in your code, now, but the order is all jumbled.


#3

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