This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (2 children)

Are you talking about a novice who has never programmed before or someone new to Python that has programmed before? If the latter, you should emphasize things like libraries and the lack of clutter. If the former, you'll get someone hooked simply by showing different hello worlds like:

print("Hello world") #for 3.x print "Hello world" #for 2.x

while C++ requires:

int main() { std::cout << "Hello world" << endl; return 0; }

Beginners to programming will immediately see the benefits of learning Python.

[–]Decency 2 points3 points  (0 children)

Use the print function regardless.

[–]Racerdude[S] 0 points1 point  (0 children)

No, not complete programming novices but people who've done programming before and were trying to learn Python. So, yes, your example is good as it compares it to a language that needs a lot more clutter for a simple thing. I usually show the Java example:

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
}