Learn Python

SyntAx

DATA STRUCTURE

AI

oop Concept

ML

Chapter - 1

 

print(‘Hello World’) #hello world

OUTPUT

  • Hello World

 

print(“hello \”world\” name”) # use of backslash

OUTPUT

  • hello “world” name

 

print(“Hello \nworld”) #\n

OUTPUT

  • Hello
    world

print(“Line A \\n Line B”) # Output Line A \n Line B

print(r“Line A \n Line B”) # r use for make normal line

OUTPUT

  • Line A \n Line B
  • Line A \n Line B

 

print(‘\\”‘”\\'”) # output \”\’
print(“\\\”\\\'”) # same upper

OUTPUT

  • \”\’
  • \”\’

 

print(” this is \\\\ double backslash”) # output : this is \\ backslash

OUTPUT

  • this is \\ double backslash

print(“this is /\\/\\/\\/\\ mountain”) # output : this is /\/\/\/\ mountain

OUTPUT

  • this is /\/\/\/\ mountain

print(“he is\tawesome”) # use escape sequence for space

OUTPUT

  • he is      awesome

print(“\\\” \\n \\t \\'”) # output: \” \n \t \’

OUTPUT

  • \” \n \t \’

print(“\U0001F60D”) # print emoji – emoji unicode from site

OUTPUT

  • 😍

print(2+4*6) # calculate
print(2/4) # floating point
print(2**5) # power
print(round(2**0.5, 4)) #round figure of floating number

OUTPUT

  • 26
  • 0.5
  • 32
  • 1.4142

a=5 # variable
print(a)

a = “deepak”
print(a)

your_name = “Deepak Kumar”
print(your_name) # snake case writing

OUTPUT

  • 5
  • deepak
  • Deepak Kumar

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.