• Welcome to ForumKorner!
    Join today and become a part of the community.

[Python] Tutorial #1 (Hello World)

Buddy_mybb_import10515

Active Member
Reputation
0
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...
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. :D
 

Buddy_mybb_import10515

Active Member
Reputation
0
Different syntax.
Not everything is different, but enough to make them too different to share one tutorial unless it's something as simple as hello world.

Don't fret though. I don't know the differences either. D:
Only that print is a function in 3. It can be used as a function in python2, but only as a function in python 3.
 

Buddy_mybb_import10515

Active Member
Reputation
0
Zennywop said:
Ok, python 3 looks easier by far. I don't know why but it looks much more simple. My opinion.

They both look the same.

Python 3 is worse. Less support, smaller library, and way more bugs.
Also anything you can do in Python 3 you can do in python 2.
 
Top