Is Python3 still relevant/am I on the right track?

Is it worth learning Python3 if I want to get a job as a programmer?

I've been self-teaching myself Python3 and honestly I've been having a lot of fun. Programming is something I've only done a few times. I took an introduction to programming course in college, then after a year I got back into it for a few weeks but abandoned it. Now (again) I started it up again and I feel very dedicated and motivated to spend a lot of my free time on it and keep going. I noticed it improved my mood because I don't feel like I'm wasting time anymore.

What I'm asking is if I should be focusing on Java or some other more popular language? I've been going through tutorials and I do feel I'm learning a lot with Python. I'm really trying to nail down and understand each concept and how things work so I'd have an easier time logically understanding the syntax, if possible. I have a list of tutorials already organized that'll get me to the skill level where I can make a pay-roll calculator that my boss would have a great use for.

I keep hearing that Java and C++ proficiency is more desirable in a potential employee. While I'm ignorant of how Java and C++ work, I really do like Python. I also plan on learning how to use django or Flask to create a website, and learning SQL (which I heard isn't difficult), because I've noticed SQL experience is often something that employers like to put as a skill requirement for a job.

Anyways, I guess my question is am I on the right track? Maybe this isn't the board to post this in, but I was curious what you guys think.

Other urls found in this thread:

pythonclock.org/
twitter.com/SFWRedditImages

I write python/C professionally and have for the last 3 years. I have never once seen anyone actually use Python 3. None of the applications I have worked on use Python 3. It's all been 2.7.

Python is a great first language to learn with. Stay focused with Python. Java and C have different use cases. People who say that Java and C are better than Python have no idea what they are talking about. They are different use cases.

For example, lets say I want to quickly hack up something that will do backups on my computer to a USB stick. I would write the script in python, and it would make calls to shell commands like rysnc, tar, gpg etc. The logic and script is in Python, but Python is still calling those commands which are basically C programs. Writing the whole thing in C is fucking stupid.

People who speak like this are basically handicapped to 1 language, and all they do is listen to what other people have said in casual conversation. They never actually try things for themselves.

Syntax of a language is only relevant to a small degree.

The algorithms, documentation, and quality of your code is all much more important than what specific language you're learning.

How to learn proper algorithms and documentation ?

>Is it worth learning Python3 if I want to get a job as a programmer?
No.
It's mostly used by scientists, most of which are """"scientists"""" and some plebs like admins and distributors.
There aren't that many job offers to write whole Python applications.

>Python is a great first language to learn with. Stay focused with Python. Java and C have different use cases. People who say that Java and C are better than Python have no idea what they are talking about. They are different use cases.

However, people saying that the Java dev team is somewhat competent and the Python team isn't are somewhat right.
On additional note: Mixing scripts with C extensions gets you the worst of both, as bindings and FFI with slow scripting languages don't scale up to actual software.
Sandboxed embedding is ok - something Python isn't that great at either - but extending will give you hell for anything more finegrained than some default trash like in the standard library.

Thanks for the response, I'll keep going with Python and see where that gets me. I know Python 2 and 3 are different, so I might learn the differences between them eventually.

Well I'm just learning the syntax so I could actually code, but I do need to learn how to document properly. I imagine quality of algorithms should increase with practice.

geeksforgeeks.org has a bunch of algorithm examples

documentation just means very legible code. Concise and to the point comments, variable names, etc.

Thanks

I need a short script written but can't seem to find the help that I need, so I guess I'll spend weeks or months learning python just so I can get a days' worth of code written.

What's a good resource to learn python?

Hey, What script you need written, maybe I can write it for you to practice if I have the knowledge. I could just paste it here.

I've been using videos on youtube by sentdex and Corey Schafer, and of course lots of googling.

>self taught programmer
Just give up now

Why?

Because you're a brainlet

No offense, but I've offered to pay people here and on fiverr and no one seems to be able to get it. It involves finding values from a list/tuple in a json from an API, and I guess that's hard.

I appreciate the recommendations for educational materials though.

I don't understand this meme yet. Can you explain?

Just don't go in thinking you're hot shit after having done a few online examples, at the end of the day you've got to be good

>if I want to get a job as a programmer?
>self-teaching
Nothing will get you a job when you are self taught unless you are some kind of prodigy, which you arent judging by your post.
Even Pajeet, the professional street shitter, will get a job before you, because he at least has some formal qualifications.

No idea how I came off as someone like that. I'm fully aware I have a lot more to learn. If I'll end up having enough money I don't see why I wouldn't continue my education.

>I've been self-teaching myself Python3 and honestly I've been having a lot of fun. Programming is something I've only done a few times.

If you're having fun, you're on the right track regardless.

When I look for a programmer, I rarely look for specific tools. I look for evidence that you get shit done, and if you genuinely like programming you will get shit down.

Also,
this guy is trolling. I know plenty of awesome programmers who are self taught. One of them didnt' even go to college

No. Python is not in fashion anymore.

Rather learn Go, it's the future.

Do I need numpy to find the value of X from the largest Y in a list X,Y pairs? Or is this something built into python?

>{"category":{"subcategory":[[5,3],[6,9],[2,2]
>return 6 as Y, because 9 is greatest X

python """programmers""", everyone..

>. I have never once seen anyone actually use Python 3
>It's mostly used by scientists
Just give up now

jesus, thats enough Sup Forums retardation for today
pythonclock.org/

If he really was trolling then it was a bit thoughtless. Somehow it felt slightly demotivating which was needless because I don't have enough money atm to go to school again and I'm putting in my free time into this.

I don't understand your statement.

>logically understanding the syntax
you don't need that
did you logically learn grammar ? I don't think so.

Wouldn't you say, at least to a degree, grammar has a sort of logic to it? You can't just be writing random words and expect to make a coherent sentence. And I guess I just meant learn syntax.

Nah, there are so much CS grads that Google can afford to only hire PhDs and Pajeets.

The programming field is already way past saturation because every single 3rd world country hands out degrees like candies.

python is the only thing ive seen used in the limited amount of SDN I've seen

as things get more hardcore due to more ips in enterprises im sure that'll change

Some hack may hire you kiddo. But don't _ever_ expect to be seen as a _real_ programmer

Your question shows a significant lack of understanding fundamental parts of the python programming langauges. This confirms the stereotype of most python programmers being programming newbies (= people that can't programm very good), whihc I tried to indicate by putting the words "python programmers" in a triple quotation mark as a rhetorical device in favour of the lulz.

Oh.. You thought I was claiming to be a programmer. No, not at all. I was just asking a question, because I'm aware that I don't understand python as well as most of the people in this thread understand addition.

Learning programming is like fighting ludwig in bloodborne.

At first some will goat you into c#, java, but once you've spend enough time on stackoverflow trying to make hello world work you will realize that python was by your side all along, your true mentor, your guiding moonlight.

grammar and syntax has a logic to it but you don't need to understand it deeply to right stuff
In fact, up to a level onky the syntax changes between la,guages that do the same thing, the concepts (for(), if, while()) are always the same

Python 2.7 isn't about fashion. Its timeless classic. Post-2.7 is shit though

I found an example that I don't think actually solves my issue:
arr = [[1,0],[8,9],[2,1],[3,2],[10,10]]
print(max(arr))

[10, 10]

It looks like it's returning that pair because both X and Y are largest, but that wouldn't be the case in my problem. If I change it so that it reads:

arr = [[1,0],[8,9],[2,1],[3,2],[7,10]]
print(max(arr))

I get the result [8,9] when I want [7,10]

Anyone know how to fix that?

cont.
I'm getting a syntax error on:
X,Y = [[1,0],[8,9],[2,1],[3,2],[7,10]]
print(X,(max Y))
I can't figure out what's wrong here.

Fair enough.

a = {"category":{"subcategory":[[9,2],[6,9],[2,2]]}}
k, v = 0, 0


for i in a["category"]["subcategory"]:
if v < i[1]:
k, v = i[0], i[1]

print(k, v)

Why should [7,10] be returned? What is your criteria for picking that list?

>X,Y = [[1,0],[8,9],[2,1],[3,2],[7,10]]

You have only one list and try to assign it at two values, that's the error.

Awesome! Though I don't really understand why that works.

If 10 is the largest Y in the list (or tuple?), then I'm trying to find the 7 from that pair.

So then is the best way to do this (which works) or can I find 7 in with some sort of modification to print(X,(max Y))?

I really appreciate the help, btw.

nobody cares, the future of python is pypy and they aint gona drop 27. also fuck guido

>Though I don't really understand why that works.

how can you not understand how it works?

k=0
v=0

>for i in a["category"]["subcategory"]:

iterates through all the values like [9,2], [6,9] and so on. in other words: "i" is always a list with the length 2: the key and the value

>if v < i[1]
i[0] is the first entry
i[1] is the second entry

if the second entry is bigger than the second entry..

> k, v = i[0], i[1]

save the new key/vale pair in the variables k and v

So it checks each individually, rewriting the stored value if larger, skipping if smaller until it hits the end, where it returns that value? Does anything else happen in the rest of the script (there's more to this) before it hits the end of the list?

> can I find 7 in with some sort of modification to print(X,(max Y))?


No, you can't.

Even if you would assign X to the keys and Y to the values, then print(X, max(Y)) is just completely wrong.

The programm would return the complete keys as X, not the single key which has max(Y) as value..

No, it's exactly like you said:

You iterate through all the values and store the key-value pair of the biggest value (so far) until the end of the list.

max(arr, key=lambda x: x[1])

Okay. I'm playing around with changing values in and getting a better understanding of why and how this can be applied.

Great. That saves me the worry of returning a temporary value accidentally.

lambda is a sort of plug-in, right? Is it faster to run this with or without it?

This is much more elegant then my solution, but I wanted to give user a solution he can understand (and modify), since he obviously no programmer...

A lambda is just an anonymous function. It's not a plugin, just a shorthand for declaring functions without a name.

I can't really speak of its performance, but since it is a function that gets called there is the overhead that goes along with creating space for the variables and stack frame, etc. If you are really concerned, you could always take a look at the implementation of max() to see what it's doing under the hood (only if you're really interested/concerned)

If you have a large data set, you could also bench it.

Okay, so that's working and this is working:

with urllib.request.urlopen("url") as url:
data = json.loads(url.read().decode())
print (data)

So how would I incorporate the two, so that in I'm pulling (k, v) from 'data' returned from url? I'm trying:

with urllib.request.urlopen("url") as url:
data = json.loads(url.read().decode())
for n in data["category"]["subcategory"]:
if y < n[1]:
x, y = n[0], n[1]
print (x)

But it's telling me that 'y' isn't defined when it was working before.

Why not just write shell script?

cont.
If I replace 'data' with 'x, y' it tells me 'not enough values to unpack', so I think that's where the problem is.

>It's mostly used by scientists, most of which are """"scientists""""

Wtf is that supposed to mean?

t. Scientist

with urllib.request.urlopen("url") as url:
a = json.loads(url.read().decode())
x, y = 0, 0

for i in a["category"]["subcategory"]:
if y < i[1]:
x, y = i[0], i[1]
print(x)
print(a)

Okay, I think this is working, it looks like it's returning the 'x' from the largest 'y' in x,y pairs from 'a'. Thanks, guys!

I am not a programmer and have no formal education in computer science. But if you are unable to come up with that solution on your own using Google in a day, you should seriously consider a career in a job that only involves very simple repetitive manual labor.

Here is why python is a good language especially for learning programming.
>Multiplatform
Unlike VB.
>Actually a marketable skill.
Used by Google, quantative finance/data science companies and system administrators. Unlike Scheme.
>Is interpreted allowing for easier debugging and TDD for beginners.
Unlike C, C++ and so on.
>Has simple easy to read syntax.
Unlike C, C++, JavaScript and so on.
>Forces programmer to use correct white space and formatting.
Unlike virtually everything else.
>Is multi paradigm (functional and object oriented)
Unlike Haskell.
>Comes with a packet manager, interpreter, editor and more all out of the box.
Unlike anything else I have seen.

Personally I believe that everyone should know at least 10 languages well.
>C
>Scheme/Common Lisp
>Python
>JavaScript
>Haskell
>C++
>Java
>BASH
>C#
>x86_64 Assembly
Above are the ones that I have chosen for myself based on industry prevelance as well as for novelty and for their different paradigms. Python is a great place to start desu senpai.

Found the paid shill.

Thank you for your vote of confidence!

>>Forces programmer to use correct white space and formatting.
>Unlike virtually everything else.

You're new to programming I'm guessing.


>Personally I believe that everyone should know at least 10 languages well.
>C
Useful in many places
>Scheme/Common Lisp
For what job?
>Python
Useful in many places
>JavaScript
Useful for webdev only
>Haskell
For what job?
>C++
Useful until you get a stack overflow because you're calling shit you don't know calls shit that calls other shit for days
>Java
Useful in many places
>BASH
Useful if you need to admin or use Unix...otherwise no
>C#
Useful in a few places
>x86_64 Assembly
No useful for anyone but OS programmers 0.1% of their career, even engineers programming drivers need not use this 99.9% of the time. Assembly for ANY processor should be studied once by serious programmers/engineers and purged from memory until the day you need it again at which time you can search or buy a book on it. Waste of life otherwise.

Learn PHP. You'll get more job faster than anything else.

Tell that to the guy making 150/yr self taught. 5 years in.

For learning purposes the difference between 2 and 3 are irrelevant and once you know one you can work in both. Any little quirks you can deal with as they arise. I use 2.7 for work shit bc that's what's supported. For side shit I use 3 bc why not.

Surely you're not serious? How is this difficult?

No idea. I seem to be making decent progress, thanks to Sup Forums. Now, it's just a matter of interfacing the script with the API.

Pip install requests

I don't know what that is...

>Python 3
>Print Is A Function
>The print statement has been replaced with a print() function, with keyword arguments to replace most of the special syntax of the old print statement

print "nigger plz"

Yes. Learn Py3 if applicable. Most differences between 2 & 3 are not too huge for most work. 2 will be deprecated in a few years, don't write in it if you don't have to.

In fact where I am anything new we just default to Py3, no point in using Py2 going forward when we don't have to.

no, just use max+itemgetter or sorted( ... , reverse=True)[0]

I want to return a value and email it to myself.

import smtplib

server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login("YOUR EMAIL ADDRESS", "YOUR PASSWORD")

msg = "YOUR MESSAGE!"
server.sendmail("YOUR EMAIL ADDRESS", "THE EMAIL ADDRESS TO SEND TO", msg)
server.quit()

But if I take off the quotes from 'your message!' or change msg in any way it doesn't send. What do?

Sorry, it was maybe a bit harsh. But have you given the problem an honest try yourself before crying out to others for help? You may surprise yourself. Or not.

I never got this, like what was the point of changing it to print()?

Loool

Never ever learn php

Initially, no. I figured it would be a short write for someone who already knows the language, whereas I expected it to take me a couple weeks to learn it (or as much as I needed for this project).

That said, I'm mostly done, and this is only the first day I've been working on it myself. So yeah... it could have been easy money for somebody.

>take off the quotes

What the fuck are you talking about? You need quotes to delimit a string. It's an error to take the quotes off.

So then how could I get the email message to contain a return value instead of pre-loaded text? Everything that goes inside the quotes is displayed as-is.

Can't you just create the string beforehand? Like msg = "hello %s" % some_name_var

Actually I forgot the string formatting syntax but can't you just create your string and make sure it's actually a string?

Maybe. This is my first day learning Python.

Python 3 has all the right decisions 2 never made at this point. Duck typing was a mistake.
def f(x: int) -> str:
return f"{x}"

right, because embedded devices don't require asm.

print() is much more flexible than special syntax. You can pass it to other functions as an argument. For example, if you are making a UI and are adding buttons, you can try giving print to it as a callback, to check what argument each button sends with its callback.

is python 3 more used than 2 yet?

Not him, but they definitely don't require x86_64 ASM

nobody said they did.

>right, because embedded devices don't require asm.

user says 'i think you should learn x86_64 ASM'
Another user replies 'no you shouldn't, waste of time'
Another user replies to that with sarcastic text quoted above, making the argument that its not a waste of time as embedded devices use it.

Did I miss anything?

Meant for