Literal Constant, Escape Sequences

Literal Constant

1. Number →  Integers, Floating, Complex numbers
2. Strings  →   Single character, Group of character

  • Numbers

    Integers → 3,5,7,100,350......

    Floating point (Fractional) → 1.4, 5.6, 3.14, 2.3....

    Complex numbers → a+ib, 5+3i......

    Long integer → 'J' or 'L'
    (12345678945L) 

    * There are three measure Problem in numbers system (You can get)

    1. Arithmetic overflow Problem → If multiply two (*) long floating points numbers will be output infinity.
    2. Arithmetic underflow Problem → (Division) → if the denominator is large than numerator than will be output zero (0).
    3. Loss of Precession Problem → 
                   
  •  Division EX:- 10/3= 3.33333333333...........Strings :- The strings can be represented any three quote
  • Single quote → ( )
  • Double quote → " "
  • Triple quote → "'    "'

    * Single quote and double quote are same (so we can represented)

    Ex:- 'Python' (or) "Python"

    * We have the use triple quote in a multiple strings

    * If any strings represented if more than one line than that multi line strings can be used triple quote.

    Ex:- "' Welcome To 
    Python Programming"'

    Escape Sequences:-

    Printing Special Symbols on the screen you have to use these Escape Sequences (we will use back slash )

    \'                      →           Single quote
    \\                      →           Slash
    \''                      →           Double quote
    \n                      →          New Line
    \t                       →          Tab Space
    \o                               Octa value
    \x                      →          Hexa value    
 

Post a Comment

0 Comments