Out of the following literals, determine
their type whether decimal / octal /
hexadecimal integer literal or a floating
point literal in fractional or exponent
form or string literal or other ?
123, 00124, OxABC, 'abc', "ABC",
12.34, 0.3E-01, "ftghjkjl",
Answers
Answer:
123 = is Decimal integer literals
0o124 = is octal integer decimal.
0xABC = hexadecimal integer decimal.
'abc' = string literals (single-line literals) single quoted
"ABC" = string literals (single-line literals) double quoted.
12.34 = float point literals (fractional form)
0.3E-01 = float point literals (Exponent from)
"'ftghjkjl'" = string literals (multi-line literals)
None = Special literlas
True = Boolean literals
Flase = Boolean literals
Explanation:
123 = is Decimal integer literals
0o124 = is octal integer decimal.
0xABC = hexadecimal integer decimal.
'abc' = string literals (single-line literals) single quoted
"ABC" = string literals (single-line literals) double quoted.
12.34 = float point literals (fractional form)
0.3E-01 = float point literals (Exponent from)
"'ftghjkjl'" = string literals (multi-line literals)
None = Special literlas
True = Boolean literals
Flase = Boolean literals
The following consists of the numbers like decimals, octal, hexadecimal, integer and floating-point numbers, fractional and exponent number form.
Explanation:
123 = integer
0o124 = octal integer decimal.
0xABC = hexadecimal
'abc' = string literals
"ABC" = string literals that are double quoted
12.34 = float point
0.3E-01 = Exponent from
"'ftghjkjl'" = string literals
None = Special literlas
True = Boolean literals
False= Boolean literals