From this post i am going to start Section-2 (Python basics). If you did'nt
read the previous post regarding the installisation of python then i suggest first go through this provided link https://dev.to/mohit355/download-and-install-python-3-x-1boo
=>> This function is used to print something on the screen. One example shown in the previous post.
=>> Syntax : print(" ") or print(' ')
=>> you can use both single quotes or double quotes but one at a time.
=>> Inside the double quotes you can write any thing can be printed on the console screen (if you are using any IDE)
if you are using the Python IDLE then it will be printed on the same screen.
String : Collection of characters inside "Double quotes" or 'Single quotes'
=>> Since we print HELLO WORLD, actually it is a string and that's why we write it in a single or double quotes.
Some Point to Know -
- Comment is for the user who is going to read the written code, comments make easy for the reader to understand the code
- comment is ignored by the Python interpreter means when you run your program comment line cannot be treated as line of code it just ignored (that's why this is only for the user)
if you want to comment multiple line then use triple quotes (''') at the beginning of the comment and at the end of the comment
A comment may appear at the start of a line or following whitespace or code, but not within a string literal.
A hash character within a string literal is just a hash character.
- Escape characters are characters that are generally used to perform certain tasks and their usage in code directs the compiler to take a suitable action mapped to that character.
2.In Python strings, the backslash "\" is a special character, also called the "escape" character.
It is used in representing certain whitespace characters
Example of Escape characters :-
a) \ newline ( Backslash and newline ignored)
h) \000 ( Character with octal value 000 )
(000 may be any integer value according to octal value )
used to print every thing inside the quotes means is there is any escape character inside then r (raw string) make it netural and
That's all for this. if you have any problem regarding escape character or any thing please let me know in comment box