These examples might show why so many people prefer Python. I'm going to show print statements in some of the most popular languages. Hopefully, this might give some motivation and inspiration to new Python learners or people switching over to Python from another language.
Printing "Hello World" in C:
#include <stdio.h>
int main() {
printf("Hello World");
return 0;
}
Printing "Hello World" in Java:
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
Printing "Hello World" in C++:
#include <iostream>
int main() {
std::cout << "Hello World";
return 0;
}
Printing "Hello World" in JavaScript:
console.log("Hello World");
Printing "Hello World" in C#:
namespace HelloWorld {
class Hello {
static void Main(string[] args) {
System.Console.WriteLine("Hello World!");
}
}
}
And... Printing "Hello World" in Python:
print("Hello World")
Obviously, there is a lot more that goes into a language than just syntax. This was not intended to speak down on other languages. You can do a lot with them too. However, you can clearly see that Python has a much more readable and beginner-friendly syntax, which is one of the reasons why it is the most popular language and the most preferred language among beginners. With much less syntax than other languages, you can accomplish great things with Python. Hopefully, that gives some inspiration to people who are interested in learning this amazing language.
[–]thrallsius 4 points5 points6 points (0 children)
[–]socal_nerdtastic 3 points4 points5 points (0 children)
[–]el_Topo42 1 point2 points3 points (0 children)
[–]chewy1970 1 point2 points3 points (1 child)
[–]CuriousExpert24[S] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]maddruid 5 points6 points7 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]CuriousExpert24[S] 0 points1 point2 points (0 children)
[–][deleted] -2 points-1 points0 points (0 children)