Python is a great language capable of being used as a programming language and a scripting language. It's completely cross platform and can be used for many purposes.
To start this off we'll begin to learn about how simple a lot of it is.
To do this we'll make a simple "Hello World!" program.
There are many ways to do this. My favorite being...
In Python print must always be lower case unless it's a string. The method of putting it in parenthesis is smarter for this tutorial because it can be used as an intro to both Python 2 and 3. Python 3 has a few differences. The most obvious being the fact that print is used as a function.
In Python 2 we can solve the Hello World with a different solution because this version doesn't use print as a function, thus there is no need for parenthesis.
There was a little confusion...
In Python 2 you can do it either way.
In python 3 you can ONLY do it this way.
-Thanks for reading. There will be more soon.
To start this off we'll begin to learn about how simple a lot of it is.
To do this we'll make a simple "Hello World!" program.
There are many ways to do this. My favorite being...
Code:
print("Hello World!")
In Python print must always be lower case unless it's a string. The method of putting it in parenthesis is smarter for this tutorial because it can be used as an intro to both Python 2 and 3. Python 3 has a few differences. The most obvious being the fact that print is used as a function.
In Python 2 we can solve the Hello World with a different solution because this version doesn't use print as a function, thus there is no need for parenthesis.
Code:
print 'Hello World'
There was a little confusion...
In Python 2 you can do it either way.
Code:
print 'Hello World'
print("Hello World")
In python 3 you can ONLY do it this way.
Code:
print("Hello World!")
-Thanks for reading. There will be more soon.