Page 1 of 8
Posted: Wed Dec 23, 2015 1:33 pm
by Troy
I know we have lots of coders on this board. I've been looking for a project recently and would love to start my baby steps towards coding. Python first. I'm a super newbie and these will seem dumb to a lot of you.
Working through an online exercise. I don't want to keep going until I can get the ouput i really want for this early problem. Messing with really basic functions.
message = "Where in the world is Carmen Sandiego"
print((message))
print("
" + "Carmen can be found at postion: ")
print(message.find("Carmen"))
print("
" + "Sandiego can be found at position: ")
print(message.find("Sandiego"))
The output is right, but not structured how I want it. I want it all in one line - when I try something like:
print("'Carmen' can be found at position " + (message.find("Carmen")) + ". " + "'Sandiego' can be found at position " + (message.find("Sandiego")) + ".")
It errors out. Any ideas? (that are super newbie friendly)
Edited By Troy on 1450896052
Posted: Wed Dec 23, 2015 1:45 pm
by TheCatt
The
are newlines. Remove those and see if it's closer to what you want.
Posted: Wed Dec 23, 2015 1:49 pm
by Troy
I added those because they cleaned up earlier exercises.
The one I can't figure out doesn't have any. I guess i really want to know how to add a variable defined (or a function on a variable) into the same line of Print() that already has "text in it".
Edited By Troy on 1450896964
Posted: Wed Dec 23, 2015 2:14 pm
by Troy
Found it. Without researching too far ahead what i wanted was the str() function.
This is what I wanted:
message = "Where in the world is Carmen Sandiego?"
print(message)
findcarmen = (message.find("Carmen"))
findsandiego = (message.find("Sandiego"))
print("Carmen can be found at postion: " + str(findcarmen))
print("Sandiego can be found at position: " + str(findsandiego))
Edited By Troy on 1450905148
Posted: Wed Dec 23, 2015 4:10 pm
by Malcolm
Ah python. That language was awesome until about a decade ago.
Posted: Wed Dec 23, 2015 4:15 pm
by Troy
Hopefully a good first one to learn and then translate to more topical languages. I'm buckling down for the learning part for now and will see if I still like it a month or two in.
Edited By Troy on 1450905373
Posted: Wed Dec 23, 2015 4:21 pm
by Malcolm
Ah, that. It's not a bad learning tool. Think they got the printf method in there now.
Posted: Wed Dec 23, 2015 4:36 pm
by TheCatt
Troy wrote:Hopefully a good first one to learn and then translate to more topical languages. I'm buckling down for the learning part for now and will see if I still like it a month or two in.
Ton of people use python, especially in the "data scientist" world. I've played around with it, but prefer other languages.
Posted: Wed Dec 23, 2015 5:01 pm
by Malcolm
Data scientist? Wtf is that?
Posted: Wed Dec 23, 2015 6:26 pm
by TheCatt
Malcolm wrote:Data scientist? Wtf is that?
Can't tell if you are being serious.
Posted: Wed Dec 23, 2015 7:00 pm
by Malcolm
TheCatt wrote:Malcolm wrote:Data scientist? Wtf is that?
Can't tell if you are being serious.
Is it a data specialist with delusions of grandeur.
Posted: Wed Dec 23, 2015 8:33 pm
by GORDON
Troy wrote:Hopefully a good first one to learn and then translate to more topical languages. I'm buckling down for the learning part for now and will see if I still like it a month or two in.
Aren't you a lawyer? I'm curious why one of those would have any use for cross training in software development.
Posted: Wed Dec 23, 2015 8:38 pm
by TheCatt
Malcolm wrote:Is it a data specialist with delusions of grandeur.
Uh, no. Generally someone with strong math background + computing. Generally master/phd level peeps.
Posted: Wed Dec 23, 2015 9:01 pm
by Malcolm
TheCatt wrote:Malcolm wrote:Is it a data specialist with delusions of grandeur.
Uh, no. Generally someone with strong math background + computing. Generally master/phd level peeps.
So ... a normal computer scientist who sucks at designing processes and spends all their time analyzing info? Or are you speaking of what I'd call a numerical specialist? If that's the case, I wouldn't use Python due to performance reasons. I'd break out Matlab, Maple, or straight C.
Edited By Malcolm on 1450922730
Posted: Wed Dec 23, 2015 9:06 pm
by Troy
GORDON wrote:Troy wrote:Hopefully a good first one to learn and then translate to more topical languages. I'm buckling down for the learning part for now and will see if I still like it a month or two in.
Aren't you a lawyer? I'm curious why one of those would have any use for cross training in software development.
I don't have a JD. I'm mostly graphic/technology support for intellectual property cases. Kind of like a specialized litigation paralegal.
I'm self taught on Adobe graphic products. I've dabbled in programming languages before, but never took the plunge to fully understand one. I think my furthest taught language before the last few weeks was HTML camp in HS.
I like my job but I also know the demand for people who can code in-demand languages is only going to keep growing. So far Python has been really fun, but ask me in a few months if I can keep up the learning.
e: and from what I have seen online, the public/free resources for learning are singularly available
Edited By Troy on 1450923271
Posted: Wed Dec 23, 2015 9:11 pm
by Troy
And I've worked with a lot of IP Lawyers who can code. As recent as this 1st qtr and 3rd qtr this year, for 2 cases I worked on.
Edited By Troy on 1450928524
Posted: Wed Dec 23, 2015 9:30 pm
by GORDON
Consider me educated.
Posted: Wed Dec 23, 2015 10:36 pm
by Malcolm
Programming is all fun and games until you break into recursion. That's when it gets interesting.
Posted: Thu Dec 24, 2015 9:04 am
by thibodeaux
TheCatt wrote:Malcolm wrote:Is it a data specialist with delusions of grandeur.
Uh, no. Generally someone with strong math background + computing. Generally master/phd level peeps.
Best definition I've heard:
better at programming than a statistician, and better at stats than a programmer.
Posted: Thu Dec 24, 2015 12:18 pm
by Malcolm
Is it a lot of actuarial computing, then?