L3rn 2 C0d3: Python Edition

>Better first language than JavaShit.

Prove me wrong.

Attached: Python.png (1487x645, 18K)

Other urls found in this thread:

humblebundle.com/books/learn-you-some-code-books
twitter.com/AnonBabble

Yes

Doesn't take a genius to see that.

Still shit

explain fgt

POSIX Shell is best
change my mind

Attached: just-use-shell.png (942x952, 103K)

Not that guy but JS isn’t known as a good first language here. JavaScript shouldn’t be what you’re comparing things to

Can anyone see why my window close right after I enter the value "pari" while I shall be able to play until my stack is 0 ?

import os

stack = 100

while stack>0:

mise = input("Mise ")
mise = int(mise)

pari = input("Pari ")
pari = int(pari)

result = randrage(50)

if pari==result :
stack+=mise*2
print(stack)

elif pari%2==result%2 :
stack+=mise/2
print(stack)

else :
stack-=mise
print(stack)

os.system("pause")

python is slow as shit and their reference interpreter is a mess but i still love it because it's very utilitarian. javascript is kinda gay and useless besides bloated electron apps and front-end.

Best way to learn python?

wtf, are you subhuman? learn scheme.

It has been some years since I last touched python but:
>randrage
If the program sees a syntax error, the os.system("pause") will be ignored and the window will close. Make a .bat with
python "main.py"
pause
If you want the window to stay.

That's not cross platform

If you're looking for slow system and custom packets, then yes, better than JS.

If you are trying to make backend and frontend to be working I must just say that JS frontends are much more mature than python ones..

install gentoo

just google it

Everyone should start out with building their own microprocessor that runs on glass marbles, then design a C compiler on top of that. Otherwise you will learn bad habits and code inefficiently with every language you use after.

AutomateTheBoringStuff.com

You can buy the book or read it in its entirety on the site. Been diligently studying it for a few weeks now. It really helped me take care of organizing a ton of files and renaming them. I'm loving Python for its immediate usefulness in my life.

You don't learn proper scoping, proper types and proper definition of a compilation/parsing process and its implications.

Check out the new humble book bundle then.
Includes this book a few others in it.

Might be worth the buck.

humblebundle.com/books/learn-you-some-code-books

py is good if you want to learn programming basics on high level language (red flag but whatever) and do it in a pseudo code -like language
it's also pushing out perl in linux scripting
and "is there a module/pkg/whatever for x" will be answered by yes in 99% of your time
also there are infinite python developer jobs (even entry level)

so yes, first language - kinda
if you wanna do it the hard way - learn python and C both as first language, get it done in python, try to do the same in C, you'll get much more from trying to get stuff the same stuff done in a whole new world, comparing the differences, etc...

You can install wsl on Windows, so yes it's cross platform.

I agree on all counts, but
>proper scoping
How so? Python has a C-like scope.

you can do all that with vim and bash tho

both languages are terrible for new programmers, you npc

why learn python when you can learn perl?

PDFs are shit though, physical books are still the best for learning

That's like saying cum tastes better than shit. Like yeah, maybe it's true, but why would I want to consume either of them in the first place?

Nice one grandpa, now go back to bed.

It has C89 shit-tier scopes.

/thread

thursday we kode

Attached: ProblemPython.png (640x400, 40K)

The only thing python has going for it is that sci fags use it so there's some good library's for data science and machine learning. Other than that it's poo. Ruby's a better language and JavaScript is easier to learn and faster than both python and ruby.

Learning Python or JavaScript first today is like learning Visual Basic in the 90s. It's so fun and easy, and it'll poison your brain. You won't learn ANY solid software development practices. You won't learn how to bang out solid novel algorithms to solve problems. What you'll actually end up doing is stringing a bunch of stuff together you don't understand. You'll learn cargo cult oriented programming. And if in the future you decide to learn a language that takes good design seriously, you'll have to unlearn all the garbage you picked up first.

This assumes unguided learning. If you have a highly competent mentor to show you how and why to write in a robust manner then you could start with almost any non-esolang and be okay. Half of writing good software is knowing how to design things well. Design is mostly language agnostic, should be your primary learning topic, and really it takes going to university and working with other competent developers for most people to grasp it all.

I learned VB.
What now, fag?

Opinions are just opinions user...

I can only learn by having fun. So learning in shit ways > not learning at all.

Yesterday I separated an array in JavaScript by doing a regex search and replace for all the commas.. It worked fine until the input data had commas.. Today I learned the proper way of doing it. I have no regrets and you can't stop me.

Attached: 1538083029839.jpg (1024x576, 55K)

Ok so if i dont have a mentor or the possibility to go to college, what language/website should i learn/use?

It isn’t hard to be better than a rotten fetid feces filled sack of garbage.

lang: scheme
books: htdp sicp

don't be an idiot. if you wanna be a webdev monkey, leave this thread and never come back. we have enough of those.

Python is a dead meme language for retards with lower IQs than pajeet and nigger hybrids.

Lua's a pretty good first programming language once you get past tables and metatables.

And metamethods... and coroutines... and 1-indexed arrays... (they're actually tables but don't worry about it)

best way to avoid this problem is to open your terminal first, then navigate to where your python file is and run it
then the terminal stays open because it is waiting for your next command

Java and Javascript have better syntax and more universal . Meme Monty python syntax is useless for other languages . No oop, spacing and indentation is a nightmare without ide. Name 1 reason why it would be good

Great tips. Any advice on where to gain knowledge from next after finishing those two?

>he didn't learn pascal, basic, or asm first
fucking kids these days, they probably cry when they can't find the answer from stackoverflow

Attached: 1525879500245.png (380x349, 77K)

Read Learn python the hard way BUT don't pay much attention to their dumb exercises, start playing around and create your own program. Feel fee to skim your way through too.

yes

create your own nethack

>mfw work on complex python project that uses metaclasses, decorators, asyncio, lambdas and comprehensions everywhere and cythonized libraries for reasons
>mfw mgmt hires code bootcamp nubs because muh cheap rates
>mfw bootcamp hires cant into nested dictionaries
>mfw they hire more bootcamp hires because other newhires cant code fast enough
>mfw army of bootcamp nubs cant into rebasing in git
>mfw i just change dns so their remote isn't real prod git so they push to my quarentine shadow server
>mfw army of bootcamp plebs push to the void and nobody knows
>mfw i finished the project quarters ago
>mfw i just do minor patches now and again
>mfw

Attached: 1538109848785.jpg (552x828, 45K)

Is this feasible? i love nethack but it would take me years just to do half of what the guys at nethack have done

well, I was half joking when i said nethack, but i think the first thing you should do to get used to python is by replicating what someone else have done. Like do BFS, DFS, Array sorting, etc.

Not going to make it.

You will only learn extremely (seriously) slowly going about it this way. You're essentially learning how to solve a maze by blindfolding yourself and turning every time you slam your face into a wall. You'll eventually get through, and your face will become hardened and numb for the next maze, but you'll have learned little about the fundamentals of the problem.

Take free online courses. Learn the boolean algebra. Yeah it's math. No don't skip it. Do a course in digital logic. What you're looking to do here is turn your boolean algebra skills into something practical. The course should start with building gates, move into state machines, then end up with building a trivial CPU from the primitives you've built upon.
Next you can graduate to ASM. Do a course on like 8080 assembly. Your knowledge of boolean logic and digital systems will be built upon here. You'll gain an appreciation for how a program is structured, how to work in tight memory, and how to write algorithms for real time applications.
At this point the SICP is actually not a bad idea, but it still might be a little difficult. I'd first take a course on the old classic: Data Structures and Algorithms. You'll probably be using C or C++. By this point you'll understand the language doesn't matter, it's about the algorithm. A lot of colleges throw this at students in their first year and they're fucking clueless, but you should actually absorb the intent of the course: To teach you how to construct arbitrary solutions to problems efficiently and correctly.
Now the SICP is highly relevant and you'll be able to appreciate it fully. It'll be like reading secret insight into the nature of reality.

And you're done with structured learning. The above should take you about two years. I'd read some books on design and cruise through the c2 wiki for practical things, but those are just suggestions.
Go ahead and work in any language. You've earned it.

Please rename your variables

Try Python4everybody through coursera if you are non-pajeet. The teacher makes learning it not boring and he gives some excellent examples. You may want to supplement Py4e with codingbat.

You should learn C first. But then learn JS. Why? What other language can you use to make a frontend, backend, iOS app, Android app, cross-platform desktop app, and even a goddamn Xbox app all in the same fucking language??? Plus python is slow as shit.

If it gets the job done and it's secure, who the fuck actually cares?
Answer: Only an autistic, closed-minded retard.

Install both 2 and 3.

Why you need C to do that?

__

Can't you fags finally realize it takes to consider how fast it you want to be developed vs runned when you consider langluage?

old JS < old python < new python < new JS

You're setting the bar about as low as it goes pal.

read -q is not POSIX.

had luck with
automatetheboringstuff. Try this

Why not simply pirate those? You can get those anywhere.

I said learn JS retard, specifically Node and React

python is fucking frustrating, recommend me a powerful language with a clear and elegant syntax

>python
>high level
way to discard your whole post

>backend to larger websites
please stop doing that, we've drived enough maintainers to suicide already.

C, haskell, lisp (but that's highly subjective)

ruby/elixir I guess
or unironically javascript, if you remove all the optional things like brackets and braces and use es6 features you can one-line almost everything

>not using brackets when programming
Oh dear....

>creating unneeded noise on your screen for no reason

Like those fucking c# users who open braces on newlines and have 120 lines of code that could actually just be like 20 if written properly.