Wednesday, January 14, 2009

Is Python one of THE LANGUAGES to learn?

Python (no, not the snake) is a powerful, dynamic scripting language that is actually not very hard to learn. It matches the object- oriented power of JAVA, and beats the utility power of Perl and Ruby (I did not write that to offend and Perl/ Ruby programmers. But hey, Perl does have more libraries, I'll give 'em that!). I once saw a program in Perl that was a guessing game. It seemed daunting, the computer knew if I was close to the number or not, if I had found it, and if I was above or below it. This was a year or two ago, back when I had just heard of Python. I thought to myself "Hmmm. How hard would it be to build this in Python?" As it turns out, it is a lot easier than I thought.

I found this code while reading:

[code]

umber = 68
guess = int(input('You only have 1 try! To try again, simply re-run the program! Enter an integer : '))

if guess == number:
print('Congratulations, you guessed it!')
print('(but can you make this program in Python?!)')
elif guess < number:
print('No, it is a little higher than that! Keep trying!')
elif guess > number:
print('No, it is a little lower than that! Keep trying!')
print('Done')

[/code]

Credit: A Byte of Python by Swaroop C.H.

I made some modifications to the original code, and it works great.

You're most likely wondering why I'm showing you this. Well, for the past few months I've been trying to compile a short list of the three (or less) best languages you can learn. I have a feeling that Python will be on that list.

Many programmers have said that perl is great for the 1st few hundred lines of code or so, however after that they "hit a wall". However, with Python, programs can stretch to an infinite number of lines and never fail. That's why Python is used by NASA (more specifically the brilliant folks down at JPL) , Google, Yahoo, and many other major companies.

Nothing's final. I've had to go through many languages to compile the list. I'm still working on it. However, I hope to soon become fluent in Python.

What I;m really interested in is using Python for heavy utilities like file encryption, firewalls, etc. As soon as I figure all this out I'll be sure to post on it.

Oh, and a quick update. I've been working on the tiny computer as promised, and it's almost ready. I've just run into a small power supply issue. However, actually writing the software for it will be a lot harder than setting it up. So, be expecting more on the computer the size of your fist soon...

2 comments:

Anonymous said...

I have never heard of this before. So, Python is a computer language? When do you use this language?

Brennon said...

Yes, you can use it for webpages, utilities, GUIs, and just about everything else. That's what's so great about it.

Oh, and sorry its taken me to post. :)

blogger templates 3 columns | Make Money Online