Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!
Ah! So good. The clean-ness of Python never stops making me happy!
Using a set was a good idea. I didn't think of that, but it would be a lot faster for checking whether or not an item was present.
I'm going to offer unsolicited suggestions, but feel free to totally ignore them if you already knew about them (probable) or don't like them, since your solution already looks really nice.
So excited about this 🙌🏻!
Python
Part 1
Part 2
I also learned about itertools.cycle through reading the Reddit solutions, that would make it so that I don't need the
while True:
I'd also suggest to use a context manager (the
with
keyword) for clean opening and closing of files.Part 1:
Part 2:
Also: "Hey checkout my Github Repo!"
True! Always forget to do that since I really only do file handling for code challenges at this point.
Ah! So good. The clean-ness of Python never stops making me happy!
Using a
set
was a good idea. I didn't think of that, but it would be a lot faster for checking whether or not an item was present.I'm going to offer unsolicited suggestions, but feel free to totally ignore them if you already knew about them (probable) or don't like them, since your solution already looks really nice.
Awesome! Yes, thank you! Found out about itertools.cycle this morning -- feels super niche but still really cool.
Part one could also be a one-liner!