This simple example shows that you can start learning Python immediately without concepts such as classes.
Since this topic is specifically about which is better as an
introductory language, I'll simply show the first example code everyone learns. Here's how you print "Hello world!" to the screen in both Python and Java:
Python
print "Hello world!"
Java
public class HelloWorld
{
public static void main (String[] args)
{
System.out.println("Hello, world!");
}
}
public class HelloWorld
{
public static void main (String[] args)
{
System.out.println("Hello, world!");
}
}
This simple example shows that you can start learning Python immediately without concepts such as classes.
Any site that where people are posting source code will have some sort of 'code' tag to keep your formatting. When I pasted the Java code above without the CODE tags, it looked terrible. Not like anything you'd show to someone learning a language, so the argument about Java being "easily posted on websites" is rather silly.
Anyone teaching Java is going to have their students indent properly, so please, lets just leave Python's meaningful whitespace out of this one.
[ Edited code tags for syntax highlighting - admin ]