0
if new.upper() == "C":
            first()
        try:
            a, b, c = re.split(r"(\s+)", new)
        except ValueError:
            return

The syntaxs error occures to the colon behind "C". if new.upper() == "C": What can i do to fix this problem?

1
  • 2
    Are you sure that your spacing is correct? In the question, it is not. Commented Nov 29, 2015 at 15:36

1 Answer 1

1

Your indentation is incorrect. It should look like.

if new.upper() == "C":
    first()
    try:
        a, b, c = re.split(r"(\s+)", new)
    except ValueError:
        pass

Additionally use pass instead of return unless that snippet of code is inside a function. Because return can only be used inside a function.

Edit: Added in the correct indentation points

Sign up to request clarification or add additional context in comments.

3 Comments

You indentation is also off man. But yeah that's the main problem that user is having. Weird to see a throw catch without the base syntax down though. May not be the issue I think.
Oh wow. Thanks for that. Didn't even notice. Very awkward there.
No worries. I have a habit of messing indentation up when pasting to this site myself. Things don't transfer that well sometimes. I still do find it odd that using exceptions he messed up indentation, maybe just came from cpp over or something I guess. That's a much more 'advanced' concept than line formatting to me but it happens I guess.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.