Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2021 Not all solutions are working #7

Open
JCCapgemini opened this issue Feb 6, 2024 · 0 comments
Open

2021 Not all solutions are working #7

JCCapgemini opened this issue Feb 6, 2024 · 0 comments

Comments

@JCCapgemini
Copy link

I wanted to use your solution as reference for the 2021 day 13 puzzle, but when I execute I get the following error:

Traceback (most recent call last):
  File "C:/Users/jcroce/develops/c/advent_code_21/p13e/day13p2.py", line 3, in <module>
    t, b = data.split("\r\n\r\n")
           ^^^^
NameError: name 'data' is not defined

If we check the code is clear that the data has not been set. By the look of the code (and testing it) adding the following two lines at the beginning make it work:

import sys
data = sys.stdin.read()

The split on "\r\n\r\n" does not work for me, changing it to "\n\n" makes it work:

t, b = data.split("\n\n")

Anyway, thank you so much for providing such precise solutions, it helps a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant