It's easy to read and it just makes more sense when someone only knows English.
I could show this to my 80 year old grandmother and have her understand what it does with minimal help on my part.
word_list = ["hat", "dog", "cat"]
for word in word_list:
print(word)
The same example in Java isn't extremely hard to understand, but it definitely is a decent jump in complexity from the almost plain English syntax of Python.
String[] word_list = {"hat", "dog", "cat"}
for(int i=0; i < word_list.length; i++){
System.out.println(word_list[i]);
}
EDIT: Forgot about Java's foreach operator, but even so with java you then have to explain what String[] means and the keyword "in" makes for an easier read than (String string: strings) and System.out.println vs print
String[] word_list = {"hat", "dog", "cat"}
for(String word: wordlist){
System.out.println(word);
}
I could show this to my 80 year old grandmother and have her understand what it does with minimal help on my part.
The same example in Java isn't extremely hard to understand, but it definitely is a decent jump in complexity from the almost plain English syntax of Python. EDIT: Forgot about Java's foreach operator, but even so with java you then have to explain what String[] means and the keyword "in" makes for an easier read than (String string: strings) and System.out.println vs print