title: What are constants and literal constants?
body: <p>I'm learning Python and I am confused with the constants and literal constants. What are they? For what kind of purpose do we use them? What is the difference from the normal variable?</p>
  <p>I'm a true beginner. As beginner, I can say I know nothing about the programming world. For example, I don't know what an expression is and vice versa.</p>
  <p>I have been learning the Python language using the <em>&quot;A byte of python&quot;</em> book and somewhere in the book I came across a section which talks about literals and constants.I share the section there:</p>
  <blockquote>
  <p>5.2. Literal Constants</p>
  <p>An example of a literal constant is a number like 5 , 1.23 , or a
  string like 'This is a string' or &quot;It's a string!&quot; .</p>
  <p>It is called a literal because it is literal - you use its value
  literally. The number 2 always represents itself and nothing else - it
  is a constant because its value cannot be changed. Hence, all these
  are referred to as literal constants.</p>
  </blockquote>
  <p>Where it says, <em>&quot;it is called literal because it is literal-you use the it's value literally&quot;</em>, I just don't get this part. What is the book trying to say that we use the value literally? Another vague point is that the number 2 is a constant because its value cannot be changed. How is it possible? We can change it, like:</p>
  <pre><code>stack = 2
  stack = 3
  </code></pre>
  <p>First, I assigned the number 2 to the stack then I changed the value of the stack (which is that number 2 that the book is claiming it is a constant so it cannot be changed) and assigned the number 3 to it. So, I easily changed the value of the number 2. I am really confused, if you didn't get my point ,please tell me so I can give more examples.</p>