You are not logged in. Please login at www.codechef.com to post your questions!

×

TEST: Need help with Python code

from random import randint
input=randint(1,99)
while(input!=42):
    print(input)
    input=randint(1,99)
print("End of output")

Generating the input from randint. Getting a runtime error(NZEC)

asked 05 Apr '12, 01:31

ko123's gravatar image

0★ko123
1112
accept rate: 0%

edited 10 Jul '12, 12:35

admin's gravatar image

0★admin ♦♦
19.0k348495533

Even its a TEST question, you should provide a question here at least.

(05 Apr '12, 19:58) mokaddim0★

Sorry !! This is the question

Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. More precisely... rewrite small numbers from input to output. Stop processing input after reading in the number 42. All numbers at input are integers of one or two digits.

(05 Apr '12, 21:46) ko1230★

the input is provided by the online judge. you don't need to generate it yourself. that's the point !

link

answered 05 Apr '12, 22:41

cyberax's gravatar image

2★cyberax ♦
3.4k21955
accept rate: 20%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×445
×347
×227
×189

question asked: 05 Apr '12, 01:31

question was seen: 1,524 times

last updated: 10 Jul '12, 12:35