No products in the cart.

In python, what do u mean …

CBSE, JEE, NEET, CUET

CBSE, JEE, NEET, CUET

Question Bank, Mock Tests, Exam Papers

NCERT Solutions, Sample Papers, Notes, Videos

In python, what do u mean by octal and hexadecimal form of numeric literals?
  • 1 answers

Danvin Desa Desouza 5 years, 1 month ago

Literals basically means a constant value expression, Suppose we have a statement: a = 10 Here a is initialized the value of the variable a to 10 of the number system decimal (base 10) (int) We could also initialize the value of a by the statement: a = 012 Note the 0 before the octal value so this initializes the variable a to 12 of octal number system (base 8) (int) (same as the value 10 of decimal). So (012) is an octal literal since it is preceded by an zero. Suppose we have the statement: a = 0xA The variable a will be initialized the value A of hexadecimal (that is 10 in decimal). Note the 0x before the hexadecimal value, the 0x indicates that the literal is a hexadecimal literal. So (0xA is an hexadecimal literal). So basically in python representing constant numerical data in terms of the number systems of base 8 and base 10 are called octal or hexadecimal literals respectively.
http://mycbseguide.com/examin8/

Related Questions

What is mean by buffering in file handling?
  • 1 answers
What are called tokens
  • 2 answers

myCBSEguide App

myCBSEguide

Trusted by 1 Crore+ Students

Test Generator

Test Generator

Create papers online. It's FREE.

CUET Mock Tests

CUET Mock Tests

75,000+ questions to practice only on myCBSEguide app

Download myCBSEguide App