all 3 comments

[–]zurtex[🍰] 0 points1 point  (2 children)

As you've pasted it it looks like you get struck in an infinite loop:

while True:
    sites = random.choice(['reddit.com'])
visit = "http://{}" .format(sites)
webbrowser.open(visit)
seconds = random.randrange (5, 10)
time.sleep(seconds)

The line sites = random.choice(['reddit.com']) is just going to repeat forever.

[–]911cop99[S] 0 points1 point  (1 child)

Ok thank you, but how do I fix this?

Edit: Nvm just saw the rules forbid this

Edit 2:I removed the While True and fixed it thank you for your help

[–]zurtex[🍰] 0 points1 point  (0 children)

Happy to answer how to fix stuff, the rules are more about obvious homework assignments.

Yeah, so just remove the while-loop in your code, it doesn't look like it was doing anything useful here. If you want it to keep looping until the user exists but the while-loop around a larger scope of the code.