¡GoConqr estrena diseño! Cuéntanos qué te parece.

Módulo 2 de 24 · Texto

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. 

 

Instrucciones

Para avanzar en el curso, envía un intento de este test. Puedes enviarlo después de la última pregunta.

Ir al módulo elegido

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?