What is Function ?
A function is a block of statements, reusable code that is used to perform a single task.
Print Function In Python
Python’s print() function prints the given object on the screen or other standard output devices.
Parameters Of Print Function In Python
- Object – That object / variable you want to print.
- sep (Optional Parameter) – objects are separated by sep. Default value: ‘ ‘
- end (Optional Parameter) – end is printed at last. Default value is \n
Print Function does not return any value.
Examples of Print Function
print("Python is Awesome") a = 7 # 2 objects passed print("a =", a) b = a # 3 objects passed print('a =', a, '= b')
Comments In Python
There are 3 ways of creating comments in Python.
# This is a comment -> Using Hash Symbol
“ “ “This is a multiline comment. “ “ “
Using Triple Times Double Quotes On the Start and End.
‘ ‘ ‘ This is also a multiline comment.’ ‘ ‘
Using Triple Times Single Quotes On the Start and End.
PyCharm ShortCut For Comment And Un-Comment
Short-Cut of comment and un-comment in py-charm is ctrl + /