Why my codes run so slowly?


#1

it takes 1 minute for last five pages of the Pyglatin to finish running, is anything wrong with my codes?


#2

We really cannot say without seeing and testing your actual code. Please post links to lessons and your code in raw text format.


#3

https://www.codecademy.com/courses/learn-python/lessons/pyglatin/exercises/testing-testing-is-this-thing-on-?action=resume_content_item

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

#4

The code looks fine except for the inconsistent indent (four spaces recommended).


#5

Thanks, even I modified the indentation, it was still very slow. Thus I cannot test my codes.


#6

Try a page refresh then run again. What happens?


#8

OK,it somehow helps. Hopefully ,refreshing the page works all the time.Thanks!


#9

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