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 8844999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:37:47+00:00 2026-06-14T11:37:47+00:00

SingPath is an interactive problem set website that tracks your progression within multiple programming

  • 0

SingPath is an interactive problem set website that tracks your progression within multiple programming languages. Unfortunately it has some bugs. The largest is the error:

Your code took too long to return. Your solution may be stuck in an infinite loop. Please try again.

appearing multiple times when you run your problem set code. Now all you have to do to correct the bug while answering a problem set question is to just rerun the code.

However, within the problem creator it creates a HUGE issue. Essentially you can run the code until it works in the creator as well which is not the problem for testing. The issue stems from submitting the problem/solution due to the fact that the submit button reruns the code. This means you need to get two consecutive correct answers which are near impossible to get (I’ve been trying for an hour now). The fact that creating a problem is required to continue within the problem set is quite ruined on the buggy creator.

So (finally) here’s my question, How can I make the following code run without this error in the creator?

Code:

import string
import random

# Takes a blank string then replaces it with 3 random letters/numbers.

def string3(s1):    
    s2 = ''
    def randstring (size = 3, chars = string.ascii_lowercase + string.digits):
       a = ''.join(random.choice(chars) for x in range(size))
       return a

    ''' If the string brought in isnot equal to the string generated keep
        rerunning the random string generator '''

    while s1 != s2:    
        s2 = randstring()

    return 'True'

Sample function calls:

>>> string3('abc')
'True'
>>> string3('a2d')
'True'
>>> string3('234')
'True'

What the code does:

The Infinite Monkey Theorem states that

Given enough time, a hypothetical monkey typing at random would, as part of its output, almost surely produce all of Shakespeare’s plays.

Create a function string3 that would randomly generate strings of 3 characters until those character’s are equal to the string received from the function. Hint: Search for a random string generator for reference. All characters in a string will be lower case.

I am a beginner programmer and I would like if some comments were put it so I can understand more complicated solutions although I would be grateful for any help/suggestions!

Also, I have already notified the support staff at SingPath for the bug but I would like to get as much practice in today as I can! If it’s impossible to potentially fix the bug on the client side I completely understand! Best of luck!

IMPORTANT EDIT

I forgot to mention that this bug will happen regardless of loops within the code. While my program is very intense with the constant random assignment of characters I know it isn’t the issue (it might be AN issue but not THE issue XD). If you don’t believe me try to create a problem here: http://singpath.appspot.com/

Even a simple function declaration and return such as:

def add_one(n):
       return n+1

Can cause the loop bug! If I can do anything on my side (exception statement?) Please let me know!

  • 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-14T11:37:48+00:00Added an answer on June 14, 2026 at 11:37 am

    Your code may be slow, but you’re going to see that error no matter what you do. I just logged in there and started my way down the Python path and got the same error with the not-very-computationally intensive:

    oops=317
    

    What appears to be happening to that site is that it’s being slammed by too much traffic. (Back in the day, I’d say they were being slash-dotted, but I guess it’d be more correct to say they’re being stackoverflowed. 😉

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

Sidebar

Related Questions

I am beginner trying to complete a simple JSON problem on SingPath which asks
In Singapore, we are teaching students python using Singpath ( singpath.appspot.com ). In addition
I am doing exercise on Singpath and I am stuck at this question. This
I have a hashmap that I am loading into a simple adapter public static
I am working on a music contest site which has a lot of instances
I have a class that must have some static methods. Inside these static methods
Winkleson here with another question for a http://singpath.appspot.com problemset question. I am a beginner
In advance, I have searched for a solution to this problem already but there
I have a need (unless you can think of a better way) of passing
i wrote the code like below and i am getting the memory leak at

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.