CBSE Class 10 Computer Applications Question 25 of 31

Python Revision — Question 13

Back to all questions
13
Question

Question 13

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

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.