KnowledgeBoat Logo
|

Computer Applications

How many types of integer literals are allowed in Python ? How are they written ?

Python Funda

5 Likes

Answer

The types of integer literals allowed in Python are as follows:

  1. Decimal form — Integers written in decimal form do not begin with a zero and contain only 0 to 9 digits.
  2. Octal form — Integers written in octal form begin with a 0 and contain only 0 to 7 digits.
  3. Hexadecimal form — Integers written in hexadecimal form begin with a 0x and contain only 0 to 9 digits and A to F or a to f letters.

Answered By

1 Like


Related Questions