Hacker Newsnew | comments | show | ask | jobs | submit login
Python for Beginners (pythonforbeginners.com)
103 points by codingblues 922 days ago | 58 comments



From the Lists Chapter:

Lists are very easy to create, these are some of the ways to make lists:

emptyList = [ ]

strlist = ['one, two, three, four, five']

I find the "strlist" example very misleading, as a beginner might think we are creating a list of five strings, when it is actually just one string with some commas in it.

-----


Likely an autopilot bug. It's almost second nature for a lot of coders to do this when making a list of strings.

strlist = 'one, two, three, four, five'.split(", ")

That habit probably just kicked in a little when putting in that example.

-----


Indeed, although the commas are superfluous.

-----


The space character argument is also superfluous as it is the default.

strlist = 'one two three four five'.split()

-----


This has lots of incorrect (syntactically or semantically) and bad (coding-style-wise) code. I'm afraid there's no way I am going to recommend it to anyone.

As some examples, the first two pages that I looked at:

http://www.pythonforbeginners.com/dictionary/:

- variable shadowing (e.g. naming a list instance `list` and a dict instance `dict`)

- Syntax errors (e.g. ``dict.items.()``)

- Teaching bad methods of iteration (e.g. ``for key in dict: print dict[key]`` rather than ``for value in dict.iteritems(): print value``)

- Also disappointing: no mention of the typically-more-efficient iter* or view* methods.

http://www.pythonforbeginners.com/web-scraping-with-python/s...:

- The written word fails me utterly. Just consider the last example, which is the worst. Just look at it. (Quite apart from some of the code being missing!) Ugh!

-----


I just recently fell in love with Python while writing a Sublime Text plugin but I'm still very much a beginner and I'm not sure if the format of this blog is great for beginners.

1. The formatting of the posts need some work. The text is often intimidating because its in big chunks and where there are code blocks there isn't any clear way to distiguish them from body copy. The way http://codular.com/ does it is real nice, maybe some of those ideas would work for this.

2. Some of concepts need to be explained more. In some of the articles you tend to gloss over some big things that a beginner wouldn't know.

I may be a beginner to Python but I'm not a beginner to programming so that's where I'm coming from. I think its good but it could be a lot better though.

-----


You are right, and I'm working to get the formatting issues fixed. The way codular.com does it is very nice. If you have any more ideas or feedback, please contact me. Thank you!

-----


Hello everyone, I'm the admin of pythonforbeginners.com . What a day! Being on the first page of Hacker News was really unexpected and I was pleasantly surprised. Thank you for all the comments I have received. I have a lot of work to do, which is super exciting and I'll do my best to fix the formatting issues and to get the website more structured so that new users easier can find out where to start.

If you have any more suggestions or feedback to give, I'd be grateful to hear them.

-----


It would be nice to have a very basic starter's tutorial involving stuff like 'how to install and setup python, how to work with python shell' absolute beginners might find it useful...

-----


Isn't that stuff already very well documented in Python's own documentation?

-----


This is a nice layout but I'm afraid the blog structure is less than optimal. For a beginner, the priority of lessons is not their chronology of publishing, but of their logical place in the learning process.

Also, the taxonomy needs work...I don't think this is what I have in mind when I see the "basics" category of a beginners reference to Python:

http://www.pythonforbeginners.com/category/basics/

Basics for beginners should include such things as "what is programming?", "how do I install python?", "how do I run a script?" And so forth.

-----


Thanks for your feedback. I will write more basic articles as we go. In fact, the latest post "Download and Install Python" is a start of doing that. I want the site to be for all python users, even though the site name is "pythonforbeginners".

-----


agreed... despite of a nice interface, the site does lack organization and some super beginner stuff, I did overlook the absence of those...

-----


Super Beginner stuff is on the standard python tutorial. That normally doesn't need to be on every website.

-----


Well, this is "Python for Beginners", so that name will attract the kind of person who has never touched the command line. Likely they'll be using a system in which Python is already installed, but they still won't know how to access it.

Another thing to keep in mind: this kind of beginner will also have trouble finding these "standard" tutorials that have up-to-date info. No, it's not that they can't use Google, but they don't have enough technical sense to tell what's a good source of this installation info from what's a bad source. Hence, it's good to have this super-basic info packaged into any kind of tutorial that purports to be for "beginners".

-----


True. A search for python tutorial returns the official python tutorial. But, I hear your point. It should be added, or a least a link to the very beginner material should be provided.

-----


I think Python is one of the easiest languages to pick up with a plethora of content available to start. Yet I have seen some crunch in number python programmers in the market lately. Companies struggling to hire python guys. Not sure why?

-----


Possibly because the demand has increased? We're a Perl shop and have absolutely no chance of finding professional developers on the market, we've actually considered switching to Python (despite the language's similar to Perl deficiencies: multithreading (GIL) and lacking performance, but I digress), but I suppose we won't be any more successful trying to hire people if we do (this is my impression from looking at job offers and talking to students).

Seems like the only choices for now are Java and PHP, at least here in Austria - and I'll probably stop programming myself if we switch to any of these.

-----


I started a job as a web designer in Dec 2011 only knowning HTML/CSS. I picked up a little PHP and JS knowledge.. not much, but working with WordPress it kind of just happens.

I tried Learn Python the Hard Way, but when I finished the book I didn't feel like I had the skills to start a project, so I read the Django Book. I am more of a designer than a developer, I really want to get over the hump and start writing code that can do the things I envision.

I've tried codecademy, which is helpful, but I still don't feel I'm there yet. I have started a "web app", but I got stuck on a few features I want to add, so I'm stalling on those.

I'd really appreciate any guidance! No formal education, all self taught. I have grown immensely as a web designer over the past year, but my programming skills aren't growing nearly as fast...or at all anymore.

-----


I guess you're talking about only Python. Well, as I said its one of the easiest language to pick up. Python's own documentation is a very good start. "Introduction to python" and "Dive into python" are good start. Huge list - http://wiki.python.org/moin/PythonBooks.

If you're talking of django/web-frameworks, well it'll be a little more effort since it involves some stuff (concepts of MVC, etc) other than python per se. So you could start by understanding of web development in general. But django docs tutorials are also pretty good.

-----


I learned Python because I wanted to make stuff fun little scripts in Blender. Tutorials helped. So did reading source code and drawing inspiration from it. Ultimately, it was just one project inspiring another inspiring another.

In your case, I guess the thing to do would be to google an open-source django app. Find something you like from the templates director. Copy what you like and build out from there.

-----


Thanks for the suggestion. I have ideas I just don't know if I should start with those, or work on open-source projects beforehand. I think I'm going to go with the ladder.

-----


You need to take a computer science course , which will teach you how to think.

The Python exercises on codeacademy are there to strengthen your grasp of python syntax and practice for loops.

I recommend Udacity CS101 and/or edx 6.00x. Both are Intro to CS courses which use Python.

-----


Thanks. I have heard of Udacity, just never looked into it.

-----


How are you seeking help when you get stuck? It's really important to have someone that can help you go over the big hurdles. It doesn't have to be a specific person in particular. You can go on irc.freenode.org #python and ask questions there. People are helpful most of the time.

-----


Thanks. I've just been checking StackOverflow, and I hang out on IRC from time to time.. I had a programming mentor who I met via Reddit, but he went MIA on helping me out after a few months payment. :[

-----


I would help you, but I don't know how much free time I'll have in the future. You can e-mail me your questions and I'll answer when I can. If I think that some of the answers can be found by googling, I'll tell you so, and I'll give you explanations where I think they're needed.

This makes me think that a program that connects mentors and students would be very useful. I'm not necessarily thinking of it as a money-making endeavour, but some resources need to be found to make the project self-sustainable.

-----


Find programming projects that you want to work on, and just start programming. Sometimes you will need to look up how to do X every line and sometimes every 5 lines, but the way to learn to program is by getting started and getting used to structures and control.

-----


This is funny. When I started learning programming with Python last year I kept reading about the scarcity of python jobs. Did it change so fast?

-----


I think there aren't that many Python jobs compared to Java, PHP, C#, but they're starting to increase.

It is strange to me as well, that I see so many people passionate about Python and, at the same time, I hear so many companies having difficulties finding Python devs.

One reason could be that the interest in Python varies by country. For example, in Romania there are very few Python programmers. Secondly, maybe the companies have too high expectations, asking for front and back-end experience and maybe even some low-level skills (C, C++).

-----


Ever heard of Paul Graham's Python Paradox http://www.paulgraham.com/pypar.html its a little old but still awesome and relevent

-----


It's relevant if you replace Python with something newer.

-----


I've also found Python incredibly easy to pick up, but that may be because it's my nth language and not my 1st, 2nd, etc

-----


Nope. Its far more easier than C++, Java. I'd say even easier than other in its league such as Perl, Ruby, etc. but that would be argued I know. But no doubt, its a good candidate for 1st language.

-----


If anyone is struggling to find Python programmers shoo tme an email. I know of a couple.

-----


The problem is that it's easy to find people who put "Python" on their resume. Hard to find people who are good at it.

-----


True. I'm one of those true Python guys. That's why I know of others. Nuuton is being build with Python (Django for the front end of things). And I'm currently building an ad platform with it. So, if anyone needs to find good Python programmers from a Python programmer, let me know.

-----


really trumps me... almost every coder I have ever met who has tried hands on python loves it...(easy to see why) and there isn't any scarcity of em. yet, its proving difficult to find a python guy to hire for our startup...

-----


Where are you looking? There is a massive community of python developers on linkedin: http://www.linkedin.com/groups?gid=25827

-----


I realize it was pretty dumb of me to forget about linkedin groups... thanks. But the fact still holds (atleast in my country, India... scenario might be different for different countries or even localities) 'number of coders in java' > 'number of coders in python'

-----


PyCon India and foss.in are good events to meet passionate developers. Likewise, local developer meetups (like Bangpypers; Banglore python group), are another great venues.

``'number of coders in java' > 'number of coders in python'

Well, that is a no-brainer, since its the most popular language taught in colleges with C++ a close second. That said, there are a _lot_ of smarties coming out of colleges and its just a matter of polishing the diamonds in the rough before they get 'lured in' by low paying IT companies. I don't see why Joel Spolsky's tactic of 'snatching' promising young talents before even hitting their final year in college won't work; albeit a little work from your part.

-----


Not dumb. I only discovered Linkedin Python groups yesterday. I didn't mean to come off as condescending.

-----


It's cool... that wasn't condescending. I actually never thought of my linkedin connections/groups as potential co-workers...

-----


Not very surprising. When I think of connections, I rarely think of Linkedin. I don't know what sucks about it, but something surely does :)

-----


trumps me too, We have a similar situation in my team, trying to find someone with even little python experience is becoming a painful task

-----


Looks great, I think the website needs better code highlighting with larger fonts for text and code. Definitely disqus comments will help a lot. Are you looking for guest posts ?

-----


I was thinking if it could be made into a wiki... but guest posts would be great for now. I just really like the site as it is the format that learn in, so I shared it here... I have requested the site owner to join this discussion... hopefully they'll like some suggestions here.

-----


All inline comments should come with a space after the #. All dictionary literals should have no spaces immediately within { and }. All multi-line dictionaries should be aligned one character after the opening parenthesis. There exists a line with "for key, value in dict.items.():", which is invalid. Use of one-liner "for" statements is discouraged. "if not a in b" is a more easily translatable statement than "if a not in b".

-----


Thanks solox3, are you referring to this line? ## .items() is the dict expressed as (key, value) tuples print dict.items() ## [('a', 'alpha'), ('o', 'omega'), ('g', 'gamma')]

-----


Pretty. Appears to be a simple document but won't show anything without javascript enabled--should not be a requirement. Document text doesn't wrap when font-size increased, leads to overflow. Fifth word is a typo. Carry on. ;)

Just realized that the text is in a pre tag with the font set to a proportional font. That needs to be changed.

-----


As someone who is learning python as their first programming language this was very helpful.

-----


Thanks!

-----


Please please please use a mono-space font for code!

-----


Will do. Thanks.

-----


Hey, I just followed up and checked out the site. It looks rockin' with SyntaxHigherlighter.

Another idea, which takes some more work, is that whenever I mention a variable-name in a paragraph I have a <span class="code"></span> around it, and I style it to look like a little piece of monospaced text.

Here's an example: http://peterconerly.com/blog/django-loves-locals

-----


This looks great, but still needs more content, and maybe an actual tutorial or interactive component.

-----


I seriously think such a site should go 'wiki' and allow addition/editing of posts by public (moderated, of course). that would be a good idea to implement for any programming language

-----


Great site for articles, definitely will be going through them.

-----




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: