helioRocha's blog

By helioRocha, 10 years ago, In English

Greetings. I need some help, please. Code runs ok inside the custom test as well as offline in my pc. However, here is the Judgement Protocol:

Test: #1, time: 92 ms., memory: 20 KB, exit code: 1, checker exit code: 0, verdict: RUNTIME_ERROR

The proposal was coded in python 2.7 as follows:

z = input().lower()
a = range(len(z))
b = [z[i] for i in a]
c = range(len(b))
d = 'aeiouy'
e = [b[j].replace(b[j],"."+b[j]) for j in c if b[j] not in d]
print ''.join(e)

Thanks!

7555759 118A - Упражнение на строки

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
10 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

The code you provided appears to be Python 3, not Python 2.

EDIT: Actually, now that I tried, it doesn't run on either version of Python, so I wonder how you got it to run on your PC at all.

Change input() to raw_input() on the first line if you want to run this code in Python 2. Place parentheses around print on the last line if you want it to run in Python 3.