By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,001 Members | 1,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,001 IT Pros & Developers. It's quick & easy.

Python iPod challenge

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
> 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

P: n/a
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

P: n/a
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.