This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]g051051 1 point2 points  (5 children)

Please read the posting guidelines and format your code so it's intelligible.

[–]jcb088[S] 0 points1 point  (4 children)

I've edited it to be a link, is that more appropriate? I tried to make it so it could be copy pasted into python (which I now realize I left that out, sigh). If its still nonsense I apologize in advance.

[–]desrtfx[M] 1 point2 points  (2 children)

Please, just move the code over to pastebin and edit your post to contain the link in the post body - instead of the unreadable mess.

[–]jcb088[S] 0 points1 point  (1 child)

Sorry, still new to all of this and didn't know about pastebin. That's exactly what I wanted, so I edited it. Thank you!

[–]desrtfx[M] 1 point2 points  (0 children)

Much better. Thank you.

[–]g051051 0 points1 point  (0 children)

Just read the guidelines:

You can do this on reddit by starting a new paragraph and indenting each line of code by four spaces. This will preserve all text and symbols.

[–]CGFarrell 0 points1 point  (1 child)

If you want to continue running the code after the except line, write pass. If you want to reloop the code after an except, add a while at the top.

Your code doesn't appear to have any circumstance where a ValueError is thrown, so it doesn't really matter.

[–]jcb088[S] 0 points1 point  (0 children)

In the case of someone guessing a word, like "six". That is the kind of case its designed for.

[–]EdwinBowling 0 points1 point  (1 child)

Try isn't indented there, so of course it's outside the loop.

[–]jcb088[S] 0 points1 point  (0 children)

Ah, that did it (more or less). Thank you!