This one’s pretty simple, just print “Hello World”. It’s a very common thing to do when you’re learning a new programming language, and in regards to this I’ve found a like for codecademy, I think it’s great for learning languages as it safely takes you step by step in a very interactive way. I used it to learn python and finished the course in less than a 24 hours, and although I can’t say I master the language, I do know how to do what I need.
But back to coding issue, python is very very simple. For your program to print “hello world” you just literally need to type:
———————————————————————-
———————————————————————-
Yes, as easy as that. This should work for both, python 2 and 3. I do rather work with the former, as most of the forums and help you may be looking for are most likely found in that format, but the differences are minimal. The big difference about both versions in regards to this hello world code would be that python 2 accepts print with or without parentheses, while print will only work in python 3 if it has them. input and raw_input is also another big difference, and speaking about it I might as well start using these:
———————————————————————-
Python 2:
Python 3:
———————————————————————-
Now, if you’re new to python, I’d like to encourage you to try to figure out what this means before reading the explanation.
Here, whatever you write in between the parentheses will show on the terminal/shell. raw_input/input is for the user to write and input something into the program, the code right here will print whatever the user inputs. But it only does it once… so what if the user wants to print more than just one message? Worry
Continue reading “WSQ02 – “Hello World”” →