day 3# - Comments, Escape Sequences and Print Statement!

*COMMENTS-

       Comments can be used to explain Python code.

       Comments can be used to make the code more readable.

        Comment Statement can not be Execute 

     Comments starts with a # , and python will ignore them.


    Ex.      # this is a comment 

               print("hey I am a student")

   ex.2    #this is a single line statement

           input-   print("this is a print statement")

           output-  this is a print statement

*MULTILINE COMMENTS

#It will execute a block of code if a specified condition is true.

#If the condition is false then it will execute another block of code.

Input-

p = 7

if (p > 5):

    print("p is greater than 5.")

else:

    print("p is not greater than 5.")

OUTPUT-

   p is greater than 5.


*THE USE OF MULTILINE STRING

"""This is an if-else statement.

It will execute a block of code if a specified condition is true.

If the condition is false then it will execute another block of code."""

INPUT-

p = 7

if (p > 5):

    print("p is greater than 5.")

else:

    print("p is not greater than 5.")

  OUTPUT-

      p is greater than 5.


*Escape Sequences Characters 

In a Escape Sequence is Black-slash ( / ) followed by the character you want to insert

1.print("hey I am a good boy and this viewer is also a good 

2.boy/girl")

you know you have wrong input

# python say "don't be use second line for this program"

use  /nand

 1. print("hey I am a good boy /nand this viewer is also a good 

    boy /nand girl

Output-    

hey I am  a good boy


*and this viewer is also a good boy/girl

what was (black-slash)/n ?

it is an scape sequence characters*




Print Statement-

the syntax of print statement look something like this :

print(object(s), sep=separator, end=end, file=file, flush=flush)






Comments

  1. Wow hardik bro you are very great coder. Please make a programm to detect car number plate. and also read my blogs on swastikcoder.blogspot.com and swastikrcoder.blogspot.com

    ReplyDelete
  2. Make the date 17th May in your mind as my birthday

    ReplyDelete

Post a Comment

Popular posts from this blog

day #6 - Exercise 1: make two Calculator using in python

day #5 - Operators in python