2. First Program


Now that you have Python ready, we can continue to write our first program. Type the following code in any text editor or IDE then save it, in my case I named it hello.py.
print("hello!")
print("This is my first program!")
print("I will enjoy this tutorial so much!")
To run the script, type python hello.py, in the command shell. You should be able to see to output.


Let's print more, try to add this program in hello.py.
print("I'm very excited that my first program worked well.")
print("I'm looking forward to learn Python much more.")
print("I realized that coding is fun.")
print("I feel my fingers is itchy to add more lines of code.")
print("Hope you guys can try it too")
OK!, try to run your program again, type python hello.py in your command shell.



Congratulation! Now that you already wrote your first program. In the next tutorial we will be often to use print(). As an exercise make yourself comfort with print().

Subscribe to receive free email updates:

Related Posts :

  • 1. Python Introduction Python is a cross-platform programming langauge that run on mulitple OS like Windows, Mac OS X, Linux and Unix. Today's most Linux and Mac… Read More...
  • 2. First Program Now that you have Python ready, we can continue to write our first program. Type the following code in any text editor or IDE then save … Read More...
  • 7. Python Loops In Programming, there might be situation that you need to execute particular block of code multiple times. Python loop provides various s… Read More...
  • 8. Python Strings String is one of Python data types that we've talked about in our previous tutorial, now we're going to learn more about Python string a… Read More...
  • 5. Python User Input In the previous tutorials, we directly assign the values into variables before we run the program. How about if you want to enter your own… Read More...

0 Response to "2. First Program"

Post a Comment