Reasons python is the best language:

Reasons python is the best language:
x = [i*4 for i in range(0,3)] // Easy array building
["%X2" % i for i in range(0,16)] // Great formatting

a,b = 1,2
a,b = b,a //easy swapping


arr = [0,1,2,3,4,5,6,7]
arr[0:3] = "new", "values" // Reassign multiple array keys at once

{key: {"data": result, "processTime": time()} for key, result in OUTPUT} // great dictionary creation

// Dictionary work is a breeze
a = {1: "a", 2: "b", 3: "c"}
b = {"foo":bar, **a}

// Return as much as you like
def someFunc(i, hate, niggers):
return i*1, hate*4, niggers*5


//Strongly typed (like it or hate it)
a = 7
b = "The holocaust never happened"
whatever(a + b) // Error !

// you can import any modern technology you would ever need
import websockets (http websaockets)
import lmxl (xml parser)

//Dont have a module? Just install it naively
python -m pip install "hitler3.0"


Anything I am missing? Also python appreciation thread

Other urls found in this thread:

wiki.python.org/moin/GlobalInterpreterLock),
twitter.com/NSFWRedditVideo

That's a pretty sexy array call, not going to lie.

>def someFunc
>doesn't follow PEP8
Get the fuck out

If syntax bloat is your thing. you might be interested in rakudo star (perl 6)

I am literally shaking right now.

Why? Nothing he posted is entirely uncommon in a modern language

python is a good language for beginners but you really gotta move on to something more powerful

Wtf. No you don't.

We live in an era of JITs and distributed scaling.

Forgot about smart list emulating
x = [1,2,3,4,5,6,7,8,9,0]
a, b, *rest = x
// a = 1
// b = 2
// reset = [3,4,5,6, etc]

I did that, but I still use python as a foundation
it's easy to extend python with C or java if you need computing power

Truly the aryan race of programming languages.

I really like Python's syntax and a lot of the concepts (I'm even a fan of no braces). I do not like the way it does parallel programming or OOP, features that might become less important in the future...

If I learn python should I learn 2.7 or go for 3.0+ ?

2

Fuck off to Cred Forums, edgelord.

>I do not like the way it does parallel programming or OOP
Why? Care to elaborate?

Really? Does the older version of a language has a better future? If so, why?

>but you really gotta move on to something more powerful
At the very latest, this might have been a good decision 5 years ago, but times changed grandpa

Well, CPython has this thing called the GIL (wiki.python.org/moin/GlobalInterpreterLock), which basically means that nothing can truly run in parallel.

Classes are weird for someone like me who started with Java in school. Every class method needs "self" as the first argument, which is kinda messy. If you want to create a static method, you need an annotation (WTF?!)

>Well, CPython has this thing called the GIL (wiki.python.org/moin/GlobalInterpreterLock), which basically means that nothing can truly run in parallel.
It can actually, if you use multiple processes instead of threads.

>le cuck face

I tried that once with a test project. Maxed out at 50% cpu load

It's not that it has a better future, rather that the majority of Python material out there is still 2.x (in my experience). The 3 situation is much better than it used to be, though.

Actually, I should amend my answer a little. If you're seeking to get into work fast then you're more likely to end up calling on 2.x dependencies. However, if you're a nab just looking to start getting his feet wet and programming for fun with no particular aim in mind yet, I could recommend going for 3 straight off. You'll be better situated for the future and you can recursively learn 2.x if need be.

The differences aren't that major anyway, so if you ever run into a situation where you need to write for 3 or 2 you won't be at a loss either way.

The whining about Cred Forums is the annoying part because it always leads to off-topic derailing. Stop being such a low-test , hypersensitive baby

OP, I hope you realize that those arrays in your script are actually lists!

Thanks! I'll keep that in mind!

python requires a lot less typing than java
if you're worried about typing "self"

you can call it anything s.

it doesn't matter. it's "reference to self"

> using C-style // comments even though they're syntactically invalid in his beloved Python

Hey OP seems the mods deleted your image

Luckily I saved a copy

I'd go for 3. They are actually very similar though. A programmer experienced in either one can pick up the other in 30 minutes or so.

didn't mean to reply to u bby

The only way that happened is if you were using multiple threads. When you use the multiprocessing module in python, you spawn a new interpreter for every process and you can use as many as you want. Multithreading is good if you are i/o limited but it will only run on one cpu; that's probably what you were using.