Using "Print" statement in Python (Basic Guide).

Using "Print" statement in Python (Basic Guide).

Python Print Function. This is a simple guide using a print statement, although the print statement in python looks very simple. but many people are still confused about using this statement. Especially for a beginner python user. The print statement is a basic command in python programming. The print statement will print any data type, but most often a string data type. But any data type is possible to print. Now, follow this guide below to use "print" statement in python.

Make sure python installed correctly on your computer, you can directly python from the link below.
https://www.python.org/downloads/release/python-2712/

Writing Python Programming.

  1. Open the text editor, for this case, we can use notepad from windows.
  2. Now type this simple program list below.
  3. print "hello world"
    print "try to use script mode"
    print "Name\t\t: Andy Law\nAddress\t\t: 15604 Alexander Rd"
    print 2016
    • Explanation ;
      • The String data to be displayed must be enclosed in double quotes (".....")
      • Numeric data types can be directly written without the quotes
      • \t used for Tab
      • \n used for a new line

  • Now, save your notepad with the following name.

    • Filename: hello.py
    • Save as type: All files

  • You can save it anywhere on your computer drive, for example at E:\
  • Then click the save button

  • Execute Python.

    1. Open windows command prompt.
    2. Now, navigate prompt to drive E:\
    3. Then type hello.py following with press enter.
    4. The result should show the following picture below.
      print statement in python
      print statement in python 
    5. Finish.

    0 Response to "Using "Print" statement in Python (Basic Guide)."

    Post a Comment

    Iklan Atas Artikel

    Iklan Tengah Artikel 1

    Iklan Tengah Artikel 2

    Iklan Bawah Artikel