471,330 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

Python iPod challenge

Hi!
a friend and me are investigating how mother-tongue influences
programming productivity.
We need volunteers to take on a 3 minutes python language
programming test.
if you are interested please be so kind to visit:

http://test-iq.web.cern.ch/test-iq/step1.php?lang=en

if your native language is Spanish please do it in Spanish
language. Beginners particularly welcome

Thanks!

jose berengueres

Nov 8 '07 #1
4 1006
On Nov 8, 2:21 am, joseto...@gmail.com wrote:
Hi!
a friend and me are investigating how mother-tongue influences
programming productivity.
We need volunteers to take on a 3 minutes python language
programming test.
if you are interested please be so kind to visit:

http://test-iq.web.cern.ch/test-iq/step1.php?lang=en

if your native language is Spanish please do it in Spanish
language. Beginners particularly welcome

Thanks!

jose berengueres
Well, just out of curosity, i started the test, however, it seems a
little bugy. My answer to the first question one was:
text = 'In principio creavit Deus caelum et terram. Terra autem erat'
count = 0
for char in text:
if char == 'a':
count = count + 1
print 'the letter a appears',count ,'times.'
getting the following error:

SYNTAX ERROR Check line 3 text = 'In principio creavit Deus caelum et
terram. Terra autem erat' ^

Im not sure but i think you are looking for only one method of getting
the answer, however, there are several ways to achieve it, so, im
done..lol, no offense, but if im going to fail the test, i want to
fail because i did it wrong and not because i did it different..


Nov 8 '07 #2
> if you are interested please be so kind to visit:
>>
http://test-iq.web.cern.ch/test-iq/step1.php?lang=en

Well, just out of curosity, i started the test, however, it seems a
little bugy. My answer to the first question one was:
[snipped]
getting the following error:

SYNTAX ERROR Check line 3 text = 'In principio creavit Deus caelum et
terram. Terra autem erat' ^

Im not sure but i think you are looking for only one method of getting
the answer, however, there are several ways to achieve it, so, im
done..lol, no offense, but if im going to fail the test, i want to
fail because i did it wrong and not because i did it different..
I had similar problems. Additionally, that's pretty unpythonic
code, as the "correct" answer would be something like

print text.count("a")

which obviates the whole looping/testing/counting aspect, letting
Python just do its thing instead.

The whole thing also seemed to fail if JavaScript/Cookies were
turned off (I don't know which was the culprit...two strikes was
enough to ).

-tkc

Nov 8 '07 #3
En Sun, 11 Nov 2007 13:33:09 -0300, <jo*******@gmail.comescribi�:
it seems the problem you guys found appears...
when combining Windows OS and MSIE...
(apologies... m_._m )
Or any other OS+browser with javascript disabled.
BTW, why do you require JS? Looks like it should be possible to do it with
just HTTP POST and plain old forms...
Dont know how to fix it .(I am a begginer...)
if some soul wanna help out... the code is here...
http://test-iq.web.cern.ch/test-iq/piton_is_easy.tar

Anyway it works fine with firefox :)
The HTML code is invalid, so it works "fine" just by accident.

--
Gabriel Genellina

Nov 12 '07 #4
Gabriel,

Now it works fine with FIREFOX , SAFARI and MSIE.
(MSIE didnt like the the way prototype.js deals with CR LF)
BTW, why do you require JS?
The python interpreter comunicates back and forth via a widget
just like gmail XD. Sorry for that.

Anyway we stil need volunteers...
http://cern.ch/test-iq
Thanks!
J.

On Nov 12, 10:35 am, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
En Sun, 11 Nov 2007 13:33:09 -0300, <joseto...@gmail.comescribi?:
it seems the problem you guys found appears...
when combining Windows OS and MSIE...
(apologies... m_._m )

Or any other OS+browser with javascript disabled.
BTW, why do you require JS? Looks like it should be possible to do it with
just HTTP POST and plain old forms...
Dont know how to fix it .(I am a begginer...)
if some soul wanna help out... the code is here...
http://test-iq.web.cern.ch/test-iq/piton_is_easy.tar
Anyway it works fine with firefox :)

The HTML code is invalid, so it works "fine" just by accident.

--
Gabriel Genellina

Nov 12 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by David Mertz, Ph.D. | last post: by
34 posts views Thread by Blake T. Garretson | last post: by
reply views Thread by Greg Sandell | last post: by
reply views Thread by jack | last post: by
reply views Thread by dominiquevalentine | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.