GoConqr has a new look! Let us know what you think.

Module 2 of 24 · Text

Literals - the data in itself 2

David Khieu

Literals - the data in itself

Let's start with a simple experiment - take a look at the snippet in the editor. 

The first line looks familiar. The second seems to be erroneous due to the visible lack of quotes. 

If everything went okay, you should now see two identical lines. 

What happened?> What does it mean? 

Through this example, you encounter two different types of literals: 

  • a string, which you already know. 
  • and an integer number, something completely new. 

The print() function presents them in exactly the same way - this example is obvious, as their human-readable representation is also the same.  Internally, in the computer's memory, these two values stored in completely different ways - the string exists as just a string - a series of letters. 

The numbers converted in machine representation (a set of bits). The print() function is able to show them both i a form readable to humans. 

We're now going to be spending some time discussing numeric literals and their internal life. 

 

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?