Using "Print" statement in Python (Basic Guide).
Python Print Function. This is a simple guide using print statement, although the print statement in python looks very simple. but many people are still confused in using this statement. Especially for a beginner python user. Print statement is a basic command in python programming. Print statement will print any data type, but most often a string data type. But any data type is possible to printed. Now, follow this guide below to use "print" statement in python.
Make sure python installed correctly on your computer, you can directly python from link below.
https://www.python.org/downloads/release/python-2712/
Writing Python Programming.
- Open the text editor, for this case we can use notepad from windows.
- Now type this simple program list below.
- 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 new line
print "hello world"
print "try to use script mode"
print "Name\t\t: Andy Law\nAddress\t\t: 15604 Alexander Rd"
print 2016
- File name : hello.py
- Save as type : All files
0 comments:
Post a Comment