[deleted]
I recommend the python reference.
https://docs.python.org/3.5/reference/index.html
I recommend the python reference.
https://docs.python.org/3.5/reference/index.html
Seconding Learn Python the Hard Way. Though I went through it knowing C beforehand, so it felt redundant for the most part, the lessons being aimed at people with no idea of general programming concepts. That, and the autor's attempt at humor felt cringeworthy. Still, if it's the first language you learn, it's a good book.
I can't handle python.
As someone who has worked with a shitton of different scripting and programming languages over the years, it is probably my second least favorite. This is because I use sublimetext and I like my brackets for sorting. Having a language literally read by indentation is just... So horrid to me. I don't understand how people manage to start programming with python. lua is straightforward and easy, everything is as you'd expect it to be. I like being able to see where my code blocks end.
//rantover
In all seriousness though it can be useful and it is a powerful language. Just don't expect me to be using it unless I absolutely have to. Enjoy learning! The only place I don't recommend learning programming is in a classroom setting. (Three months for the basics of a language even though the basics are pretty much the same throughout most languages?? wtf)
Oh and check out http://devdocs.io/ and https://repl.it/languages
36161
This is because I use sublimetext and I like my brackets for sorting. Having a language literally read by indentation is just... So horrid to me.
Do you not indent your bracketed blocks?
malmon73 wrote36161
This is because I use sublimetext and I like my brackets for sorting. Having a language literally read by indentation is just... So horrid to me.Do you not indent your bracketed blocks?
Of course I do.
But there are times when a bracketed block doesn't need to be indented and in fact is simpler and easier to read non-indented. I don't like being limited or forced to do something like indentation.
Sometimes I like to indent certain lines differently in a block of code for the sake of easy reading and the like.
I've had trouble with python identation stuff.. it's similar to a thing that bugs me in Go (new google language):
You're not allowed to have any unused variables in your code or the compiler rejects it as an error. That's fine for a final product but what if I'm doing development? It just causes me extra work and gets in the way of programming, I would prefer it to be a warning. On the other hand, bad indentation can't just be a warning in python.
It's not that big a deal but it can be a little frustrating to me sometimes, for example I copy a snippet of code and want to try it out but I have to spend a bunch of effort fixing up the indentation before I can see that it's the wrong thing and delete it..
36221
I've had trouble with python identation stuff.. it's similar to a thing that bugs
me in Go (new google language):
You're not allowed to have any unused variables in your code or the compiler rejects
it as an error. That's fine for a final product but what if I'm doing development?
It just causes me extra work and gets in the way of programming, I would prefer
it to be a warning. On the other hand, bad indentation can't just be a warning in
python.
It's not that big a deal but it can be a little frustrating to me sometimes, for
example I copy a snippet of code and want to try it out but I have to spend a bunch
of effort fixing up the indentation before I can see that it's the wrong thing and
delete it..
Well, with an unused variable you should be able to just comment it out, but I agree it should be a warning. But I like how it forces you to indent propery. Indentation isn't hard, and it's neccesary for readable code. Reformatting code is usually 1 keyboard shortcut in a good IDE, and some reformat code as you paste it in. Enforcing that is a good thing.
I don't write in too much python but I had to pick it up for a project and what I found pretty useful was indentation guides in my text editor
Image no longer available
Most modern editors/ides should have that
Also please don't bully my fizzbuzz, i'm sure there is a more pythonic way to do it
36268
Also please don't bully my fizzbuzz, i'm sure there is a more pythonic way to do it
Your's looks alright! I don't really think there's much to pythonise.
You could do it like this, but I think your way of explicitly stating == 0 is clearer.
Loading Image
36268
Or in C:

Here's my recomendation:
Do the Learnpythonthehard way book. Buy it if you like, or just torrent it. Complete the whole thing. Should take a week or less. Once that is done, you should have a basic knowledge of the building blocks of python. From here you can move into taking small python projects apart to see how they work (use google and git sites to find cool python projects). Play aroudn with the source code and see what shit does. Use the pydocs and stackexchange for refrence if you don't know what something does or how it works.
Basically practice practice practice. If you think you can, go on /g/ and look for the daily programming excersices threads. Do those everyday.