r/learnpython • u/CleverBunnyThief • Dec 02 '19
Advent of Code (AoC) 2019 starts today!
Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
These puzzles are a great way to practice your Python and problem solving skills.
Edit: added description from AoC site.
2
u/Leeoku Dec 02 '19
Just curious. I'm a bit new to programming and wondered what the difficulty level is from previous participants. I did see the disclaimer on the site but just curious
3
u/CleverBunnyThief Dec 02 '19
Each day will have two new puzzles. Completing the first one will unlock the second one of the day. I've only done day 1 so far but I imagine the first one will be easier. The second one will build on the first one and add a bit more complexity.
I don't believe that there's a deadline so you can submit them later. Just sign up and have a look. I think it's a good challenge that will push you learn. Try it out and ask questions here if you get stuck.
There's a AoC subreddit so you can always go there to get help or look at other people's code. That's a good way to learn too sometimes.
2
Dec 02 '19
Different every question and different every year, there is no way to gauge a difficultly level without knowing your skill (on top of every question being of varying difficulty, hell, there is stuff in the middle that takes 10 minutes, and others that take me an hour). These aren't made for beginner's though. Just go through them if it interests you.
15
Dec 02 '19
Very cool! I'm very new at learning Python.
I solved the first puzzle, which wasn't complicated, yet I learned a couple new tricks!
Thanks for posting!
1
7
u/EphemeralNight Dec 02 '19
I'm a total beginner with python but will save it for after work to do will help to improve my skills in programming. Thank you for sharing!
5
3
u/xelf Elf Dec 02 '19
Nifty. Solved day 1 with a google spreadsheet. Something about good a programmer uses the right tool etc... =)
0
Dec 02 '19
[deleted]
1
u/xelf Elf Dec 02 '19
I'm enjoying it. I did use Python for day 2. Looking forward to the next one now!
2
2
2
u/Devnull1982 Dec 02 '19
Wow, nice webside, every exercise is very well explained and adorned with a game ( the santa claus etc...), I like it. I do the first exercise of Day 1 with Python very quickly with no problems. The second exercise it was easy too but something I was doing wrong that the result is not correct, after 20 min I see the error.
PD: Im still learning python ( with python crash course ) and I think this will help me alot. THX.
2
u/Bobbias Dec 02 '19
Day 2 was pretty fun. Ended up brute forcing the answer for part 2 by hand though. Once I caught on to how the 2 numbers interacted it was pretty quick to test different ones, though maybe I should automate brute forcing it later just for the hell of it.
Did learn how to send cookies with urllib requests though, because I figured it would be better practice to grab the data off the site rather than just save it to a file.
I'll be sure to cache the results when I make my brute force version of day 2 part 2 though.
1
1
u/CornersTheCoder Dec 02 '19
Thank you for doing this. It also looks like it goes back to 2015 which is awesome! Gives 125 projects when I learn some, even if it is not in December. Thank you again! :)
1
1
u/MiataCory Dec 02 '19
If anyone needs help, I just got through day 2.
I like the add-on questions. "Hey, you did the thing once, now make the computer do it many times!"
3
u/RoadieRich Python 2 diehard Dec 02 '19
I'm curious to know if anyone didn't brute-force day 2 part 2.
2
1
u/raglub Dec 03 '19
After brute-forcing the solution, I observed the output of each iteration and realized this is the equation that the Int code solves:
394702 + verb + noun*288000 = 394702reduced further:
verb + noun*288000 = 0Since there are two unknowns and only one equation, I couldn't come up with a clever way to calculated the solution other than brute-forcing it.
1
1
1
Dec 02 '19
Great, Thank you for posting!! I Just finished “Automate the Boring stuff with Python,” so this should be good to practice what I learned.
1
u/ffrkAnonymous Dec 03 '19
Looks fun. I'll give it a shot.
The sidebar list of sponsors showed TwilioQuest, that looks fun too!
-20
u/Thecrawsome Dec 02 '19
You have to chop out a lot of the question descriptions to what the question is actually asking you to do. Lots of bold abuse. Are you bolding terms? Are you bolding emphasis? Fuck it, bold anything just because you'd inflect on it in real speech!
5
u/CleverBunnyThief Dec 02 '19
I went back and looked at the first puzzle and only saw three bolded items "module", "mass" and "What is the sum of the fuel requirements". Those are the key parts of the whole puzzle. They are hints actually. I took module and mass and made them variables in my code.
I think it's a good idea since there was so much text on that page and not all of it is needed to solve the puzzle. I had to read the whole thing a few times to make sure I wasn't missing something.
Edit: Spaced out second paragraph.
-1
u/Thecrawsome Dec 02 '19
lol at least finish the first half of the first puzzle before you weigh in?
that
also
wishing really hard
1
u/CleverBunnyThief Dec 02 '19
I finished both last night.
Just some bold font. Don't see what the big deal is.
7
0
0
2
u/jlamores Dec 02 '19
Talking about the first puzzle.
I am an absolute beginner reading right now through the list chapter of the Python Crash Course. To solve the first puzzle I think I have to make a list with all the data and use a "for loop", but I dont know how to write all this numbers to create my list. How do you do it? You copy and paste in your code? But you don't have the commas so....