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 :

  • 9. Python Lists List is one of python data types which defined with comma-separated values (items) between square brackets. Important thing about a list… Read More...
  • 4. Python Operators In this tutorial you will learn operators that supported by Python. The following are Python operators. 4.1 Arithmetic Operator Arit… Read More...
  • 11. Python Set Sets is a collections of unordered items. Python set is similar with these mathematical definitions.. The elements will not be duplicated… Read More...
  • 10. Python Tuples Tuple is one of Python's data structures which is ordered values. Tuples are defined with brackets. Example subjects = ('math', 'biolo… 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...

0 Response to "2. First Program"

Post a Comment