Monday, September 2, 2019

printing function in python.

1) print : 
       print is a statement in python, it supports in the 2.x version of python.
       syntax:
                   print message
     example:
                    we are executing this statement in latest version of python.
       >>> print 'hello python'
              SyntaxError: Missing parentheses in call to 'print'. Did you mean print('hello python')?
       >>> 
                so this statement is only execute in 2.x python versions.

2) print() :
         print the given object to the standard output device. it supports in python 3.x version onwards.
    syntax:
              print("message")
   example:
               >>> print("message")
              message
               >>> 


No comments:

Post a Comment

type keyword in python

  Python have a built-in method called as a type. If  a single argument (object)  is passed to type() built-in , it returns the type of obj...