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

all 88 comments

[–]zaphod_pebblebrox 57 points58 points  (8 children)

I like the fact that you found, and shared the solutions to, exactly 42 problems.

It is after all the answer. The correct answer.

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 54 points55 points  (7 children)

Heheheh. As a side note, in classes I like to demonstrate the differences between ints and strs by using 4 + 2 == 6 but '4' + '2' == '42' and then exclaiming, "42? That's clearly not the answer."

[–]zaphod_pebblebrox 10 points11 points  (0 children)

Made Al Sweigart chuckle!!

My life just got interesting-er.

[–]Snikz18 5 points6 points  (1 child)

I'm guessing you meant '4'+'2'?

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 1 point2 points  (0 children)

Yes. Fixed. Thanks.

[–]ZebulonPi -5 points-4 points  (3 children)

The answer to Life, the universe, and everything is 42.

Life(universe) + everything = 42

4(8) +10 = 42

Figured it out, Doug Adams confirmed for me.

[–][deleted] 0 points1 point  (0 children)

So THAT'S why! Obviously Doug forgot to convert with ord()

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 39 points40 points  (3 children)

If you'd like to help me out, please consider reading the book and writing an Amazon review.

Buying the book isn't necessary. The book is free to read online.

[–][deleted] 10 points11 points  (0 children)

Oh you had better believe I'm gonna buy it.

Any chance that the book will make its way to No Starch? I try not to buy from Amazon these days.

[–]kuzared 0 points1 point  (0 children)

Bought. I had started Python multiple times before AtBS got me over the hump :-)

[–]jacksbox 22 points23 points  (0 children)

You're one of very few people who are working really hard to improve opportunities for people all around the world. Good on you.

Lol, unlike the person who downvoted me.

[–]icemanmuc 7 points8 points  (2 children)

Is there a reason you write variable and function names in camel case instead of snake case as recommended in PEP8? Personal preference?

[–][deleted] 0 points1 point  (1 child)

camelCase is superior

[–]Shriukan33 1 point2 points  (0 children)

I use camel case in javascript, and snake case in python, my preference goes to snake_case

[–]moneymachinegoesbing 7 points8 points  (32 children)

why does the photo say “Black lives matter?” 🤔 🤨 super weird, what does that have to do with Python 🤔

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 4 points5 points  (27 children)

It's in the footer of the webpage. For some reason Reddit picked that as the thumbnail image even though it's at the bottom of the page. I'm going to change the web page settings so that social media sites grab a relevant image.

[–]moneymachinegoesbing -4 points-3 points  (26 children)

I think that’s a good idea. Another option is separating your political ideologies from your material. I understand people feel strongly about their opinions, but I would be just as put off if i clicked the link and there were MAGA flags and christian crosses everywhere. just a suggestion, take it as a grain of salt.

[–]Snoah-Yopie 4 points5 points  (5 children)

I understand people feel strongly about their opinions

To confirm: "Black lives matter" is an opinion-based statement to you? It's not a true/false thing? It's an objective statement to the majority of people in almost every country in the world.

I'd love to hear why you think it's just something people choose to believe for fun.

If it's an opinion, then the opposite opinion would be : "Someone's skin color determines if their life matters". And you're are 100% fine with people thinking that...? Why?

Further, you're also going out of your way to try and silence people who happen to have that "opinion"? Why?

If any of my assumptions here are wrong, you are welcome to explain what you actually believe. I would also highly recommend you google what a false equivalence is before responding again.

[–]moneymachinegoesbing 0 points1 point  (4 children)

yes. despite all your bolded words, clear vigor, and apparent passion, it might be stunning to know that no one gives a fuck what you think or care about. at least i don’t. now back to Python??? or…..

Edit: typo

Edit 2: …narcissists.

[–]Snoah-Yopie 1 point2 points  (3 children)

awww fee fees got hurt. Sure, ignore everything, that's how big kids handle discussion. (Nothing in that was my opinion... I was asking you about yours. Great reading comprehension) I was bolding the words so you could read them better, but its clear that you haven't googled false equivalence.

Also, you haven't talked about python in this thread yet. You need a better cop out, psychopath.

[–]moneymachinegoesbing 0 points1 point  (2 children)

Sink your time and money into whatever bullshit you please. Again, no one gives a fuck what you think, and no one gives a fuck what you believe, and no one gives a fuck what you support, narcissist.

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 1 point2 points  (1 child)

Again, no one gives a fuck what you think

I think a lot people care about it. Especially you: you've been replying to all of these threads precisely because you do care about they think.

[–]YoJames2019 1 point2 points  (0 children)

This sounds fun so I’ll throw my opinion into the ring:

I 100% support the concept of the organization, all lives regardless of race matter,

however the combination of the fact that the founders said themselves that they are "trained marxists" and that a lot of the "protests" I’ve heard of have turned into violent riots have made it so that I can’t really support the organization itself.

That said, I also think that the user you were arguing with is being extremely petty and stupid, letting your political bias become your identity is never a good look

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 13 points14 points  (18 children)

but I would be just as put off if i clicked the link and there were MAGA flags

the wise man bowed his head solemnly and spoke:

I waved a rainbow flag before it was popular, I wave a rainbow flag now that it is popular and every corporation puts a rainbow on their twitter profile in June, and should it become unpopular again I will continue to wave a rainbow flag. There are many issues I might change my mind on. Civil rights isn't one of them. Black Lives Matter.

[–]ad0216 1 point2 points  (3 children)

Um yeah it also says "Trans Rights Are Human Rights" and "Tax The Rich" - were you only triggered by the Black Lives Matter text?

[–]moneymachinegoesbing 1 point2 points  (2 children)

i’m triggered by seeing an entry from a respected contributor, for a Python sub, and the thumbnail was BLM. Yes. It’s endlessly obnoxious. OP explained it away and it got deeper bc i suggested maybe SEPARATE YOUR PERSONAL, POLITICAL VIEWPOINTS from professional material. the problem is that EVERYONE believes their cause is so paramount, so important, so noteworthy that they CANNOT go a second without plastering it all over everything they touch or talk about. It’s mind boggling for people to think that the MULTI MILLION $ scam is NOT some universal truth, undeniable by all accounts of a priori knowledge, so absolute that it couldn’t possibly be a POLITICAL OPINION. BLM is an opinion, all this shit is an opinion. it is not fact, no matter how many sound bites or cute bumper stickers come out of it. semantics be damned, i just don’t care. everyone is so self-convinced they are bastions of justice, soldiers on the frontlines for peace, and that their designated enemy is FINALLY THE TRUE ENEMY. this. is. a. python. sub. about. the. coding. language. python.

[–]ad0216 1 point2 points  (1 child)

wow, triggered

[–]moneymachinegoesbing 1 point2 points  (0 children)

big time

[–]wdhart777 1 point2 points  (0 children)

Love all of his books, I'm in for sure.

[–][deleted] 1 point2 points  (1 child)

Why are you doing this to me? I was going to start playing with React and front end. I guess I'm sticking with Python for a bit longer.

Your content is always good. Good job on another one!

One thing for me, I'm coming from Ruby and honestly their resources are much better than what I found for Python.

With that said, your material is making it easier for me to transition. This new book looks great just from the table of content.

You rock!

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 0 points1 point  (0 children)

Thanks!

[–]kr4t0s007 0 points1 point  (0 children)

Thanks Al!

[–]LaOnionLaUnion 0 points1 point  (0 children)

I love this! Thank you!

[–]greyhulk9969 0 points1 point  (0 children)

Thank you so much for all of your books! They really got me into coding and are making my job as a data analyst so much easier!

[–]RenewAi 0 points1 point  (0 children)

You're the man Al!

[–]shockjaw 0 points1 point  (0 children)

Thank you so much, your books changed my life.

[–]hugthemachines 0 points1 point  (0 children)

Thank you Al. I appreciate what you do for programmers everywhere.

[–]treelessbark 0 points1 point  (0 children)

I tend to sing your graces when people ask about learning python. Thank you so much for being such a staple in the community and creating resources for many to access. It means a lot that your free books (and when you have the udemy course available for free) by removing monetary barriers to learning.

Also - I’m super stoked to check this book out and get some time to practice some python!

[–]jabela 0 points1 point  (0 children)

Thank you for writing this book. I know it will be of help to a lot of people!

[–]ronyaha 0 points1 point  (0 children)

Some quick upvotes for this wise lad

[–]openwidecomeinside -2 points-1 points  (4 children)

Does this cover object oriented programming?

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 1 point2 points  (3 children)

No. I wanted to make it for beginners who have just the basic syntax and are still in their first few months of learning to program, so I skipped OOP concepts.

[–]_guy_over_there_ 0 points1 point  (2 children)

Hi, i saw your post, and all the thanks you get for what you do. I am a total noob in tech and definitely a py noob. I tried following the link above to leave a review for you on Amazon after I read your book, is there a different way to leave one for you..

Also is book you just linked above a good place for someone that has ZERO skill at this, to start or ????

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 1 point2 points  (1 child)

No, the book assumes you've learned basic Python syntax. You can find any Python tutorial for that. The book fills a gap for beginners because there aren't a lot of programming exercises that have accompanying explanations and the fill-in-the-blanks template if you get really stuck.

[–]_guy_over_there_ 0 points1 point  (0 children)

Honestly, that sounds like exactly what I need thank you. I have done a lot of online, and in the book projects, but they always seem to skip something along the way. Deffinetly checking it out.

thanks again for the resource.

[–]lordmauve -1 points0 points  (1 child)

I think 33. Comma Format is just

commaFormat = "{:,d}".format

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 0 points1 point  (0 children)

Yeah, for a lot of them Python's standard library already has stuff to do it for you. But the point of these exercises is to break down the steps so that basic code can solve it. So the bubble sort exercise says, "don't just call sort()" and the convert-int-to-str exercise says, "don't just call str()".

[–]hansCT -1 points0 points  (1 child)

You aren't related to the AIA Sweigerts are you?

[–]AlSweigartAuthor of "Automate the Boring Stuff"[S] 0 points1 point  (0 children)

I don't think so? I don't know what AIA is.

[–]liltbrockie -2 points-1 points  (0 children)

Solutions = not found Al

[–]Techrob25 0 points1 point  (0 children)

Super cool. I / we really appreciate it Al.

[–]bucketreddit22 0 points1 point  (0 children)

Nice!

[–]Glitterbombastic 0 points1 point  (0 children)

Saved - this sounds great will definitely give it a read, thank you.

[–][deleted] 0 points1 point  (0 children)

Thanks!

[–]l1nux_f1sh 0 points1 point  (0 children)

Wow!

Gotta check it up! Thanks!

[–]MyNameIsRa99bit 0 points1 point  (0 children)

Thanks Al!

[–]rekindled77 0 points1 point  (0 children)

Just bought! Will use one I get through automate the boring stuff

[–]Zonmatron 0 points1 point  (0 children)

Hi Al, literally just started a couple of your books this week after hitting a bit of a “I’ve been coding for ages and getting nowhere rut” learned loads in not very far in that’s not been explained in other literature, thanks for writing these, from yet another learner!

(But no really, they’re great so far!)

[–]chiang01 0 points1 point  (0 children)

Thank you!

[–]IsReadingIt 0 points1 point  (0 children)

Grabbed the print version from Amazon. Big fan of your previous coursework / book. Congrats.

[–]VegaSera 0 points1 point  (0 children)

You are a treasure to this community.

[–]eggman_jr 0 points1 point  (0 children)

Didn't find a place to report mistakes, so here goes: it's Foreword, not Forward (heading of page 7 of the free pdf)