Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8038535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:16:06+00:00 2026-06-05T03:16:06+00:00

I got an EOFError at line 87 of the following code: import random def

  • 0

I got an EOFError at line 87 of the following code:

import random
def printDice(diceList):
    upperLine=" _____     _____     _____     _____     _____"
    line1="|" 
    line2="|"
    line3="|"
    lowerLine=" -----    -----    -----    -----    -----"
    for i in range(len(diceList)):
        if(diceList[i]==1):
            line1+="     "
        elif(diceList[i]==2):
            line1+="*    "
        elif(diceList[i]==3):
            line1+="*    "
        elif(diceList[i]==4):
            line1+="*   *"
        elif(diceList[i]==5):
            line1+="*   *"
        else:
            line1+="*   *"
        if(i==4):
            line1+="|"
        else:
            line1+="|  |"
    for i in range(len(diceList)):
        if(diceList[i]==1):
            line2+="  *  "
        elif(diceList[i]==2):
            line2+="     "
        elif(diceList[i]==3):
            line2+="  *  "
        elif(diceList[i]==4):
            line2+="     "
        elif(diceList[i]==5):
            line2+="  *  "
        else:
            line2+="*   *"
        if(i==4):
            line2+="|"
        else:
            line2+="|  |"
    for i in range(len(diceList)):
        if(diceList[i]==1):
            line3+="     "
        elif(diceList[i]==2):
            line3+="    *"
        elif(diceList[i]==3):
            line3+="    *"
        elif(diceList[i]==4):
            line3+="*   *"
        elif(diceList[i]==5):
            line3+="*   *"
        else:
            line3+="*   *"
        if(i==4):
            line3+="|"
        else:
            line3+="|  |"
    print upperLine
    print line1
    print line2
    print line3
    print lowerLine

tellMe="N"
print

print "The purpose of the game is to figure out the rule."
print "I can tell you three things:\n1. The name of the game is petals around a rose,  the name is important.\n2. I can tell you whether or not your guess is right and the score of the dice.\n3. I can tell you that the score is always even or 0"
print
print "At any time you can quit by typing an odd number"
go="Y"
wrongGuesses=0
while(go=="Y"):
    diceList=[]
    score=0
    rightWrong="N"
    for i in range(5):
         diceList.append(random.randrange(1,7))
    for i in range(5):
        if(diceList[i]==3):
            score+=2
        elif(diceList[i]==5):
            score+=4
    printDice(diceList)
    print
    while(rightWrong=="N"):
        guess=input("What is your guess? ")
        if(guess%2==1):
            break
        if(guess!=score):
            print "Wrong"
            wrongGuesses+=1
            tellMe=raw_input("Tell you (Y or N)? ")
            tellMe=tellMe.upper()
            if(tellMe=="Y"):
                print "The score was "+str(score)+"."
                rightWrong="Y"
            else:
                rightWrong="Y"
            print "Right"
    if(wrongGuesses%13==0 and wrongGuesses!=0):
        print"The name is very important."
    if((wrongGuesses==30) and (wrongGuesses!=0)):
        print "The maximum score is 20."
    print

I was using the site codepad.org to run this program. I have actually run this program in an IDE but when I use this site this error pops up:

What is your guess?

Traceback (most recent call last):
  Line 88, in <module>
    guess=input("What is your guess? ")
EOFError
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:16:07+00:00Added an answer on June 5, 2026 at 3:16 am

    Your program reads user input from standard input. When running it on codepad.org, there is no user input and attempting to read from standard input will result in an EOFError.

    If you use the site ideone.com instead, it allows you to specify the user input. However, you will have to provide the entire input ahead of time rather than interactively. If your program tries to read past the end of the provided input, you will get EOFError again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got a real simple question but can't figure out the solution. Got following code.
Got the following code: $(document).ready(function() { $('a.add-item').click(function() { if ($(this).parent().find('input').attr('value', '0')) { $(this).parent().find('input').attr('value', '1')
Got this errors keeps appeared repeatedly Here is my line 20 on functions.php $wp_query->max_num_pages
Got the following error when I tried to compile a C application in 64-bit
got code looking like this: // This is com.n.common.Networking.downloadBmp( ) function // ... byte[]
Got a question regarding SQL and ColdFusion: I can't write SQL code properly, so
Got a complex reflection question. Given the code below how would you implement the
Got the warning from configure (last line): checking for getpagesize... yes checking for working
Got a bit of a mind freeze at the moment. I have the following
Got some code here that isn't working: $(#sidebar ul li:last).each(function(){ $(this).addClass(last); }); Basically I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.