So, decided to get back to programming so I have something other than my internship on my hands to deal with, and since I'd prefer a career in some sort of applied computer science. Still, I never found following tutorials to be very intuitive to learning something. So I had a little thought...
Why not work on whatever it is I feel I need more practice in, and post what I did over here? I mean, when has depending on the charity of strangers online ever been a bad thing? I can screw up, people can point what I did wrong, and I can learn and move on.
Slight heads up though, I'm not exactly known for sticking to anything, so this might die out tomorrow, or the day after, or something, but at least I'm doing something.
Anyway, here's the first bit of python scripting I've done:
def main():
print ('Who are you?')
#s1 here is a variable, it prolly can use a better name, but it works for now, and this is a relatively small program.
#You may be wondering something if you know a thing about java or C but nothing about Python. Variables usually come in several flavors, and python seems to assign them based on how they appear. I tried putting str behind s1 to call it a string (IE a thingie that stores a number of characters in whatever order you desire [sorta] but that stops the program from executing right)
s1 = raw_input()
print ('What do you say?')
s2 = raw_input()
#Okay, so this bit is a teeny tiny bit tricky. You see those braces down there? You can have the program go ahead and stick something where they are if you put .format() right after it. It works with other strings, but it seems a teeny bit pointless to have something like .format('knights' , 'ni!') in there. To me anyway. Having strings that are defined beforehand seems better, and you can do some fun stuff here. This code can prolly be modified to pick two random things to say here and stick them in for added hilarity, for example. So it's basically more flexible, and flexibility in a program can be a very good thing when you need to modify it later on.
print 'We are the {} who say {}'.format(s1,s2)
return 0
Anyway, that's what I have for now, since I'm still learning the ropes of python. I'd still want to tackle input and output for a while, but I'll also be going over control statements quickly, then move onto classes and such.
Got a comment? Want to ask a question? Go ahead post. I might not be able to answer it, but I'm sure someone else here can.