Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Integer Numbers | Conhecendo os números em Python
Tipos de Dados em Python
course content

Conteúdo do Curso

Tipos de Dados em Python

Tipos de Dados em Python

1. Conhecendo os números em Python
2. Verdadeiro ou falso?
3. Strings
4. Reunindo todos os tópicos

book
Integer Numbers

You might be accustomed to specifying numbers in ways such as:

  • 1,000,000 (with commas);
  • 1 000 000 (with spaces).

However, Python will not understand this.😢

These formats are understandable for a person but not for a computer, so the right way is 1000000 without commas or spaces.

Tarefa
test

Swipe to begin your solution

Here is the distance from the sun to the Earth in miles: var1 = 91,400,000. And here is the distance from the Earth to the moon: var2 = 238 855. You need to adjust these number formats to be compatible with Python.

Rewrite the values of these two distances so they are recognizable by Python.

Solução

Note

If you have a strong desire to use separators, Python understands the following syntax: var = 1_000_000.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 3
toggle bottom row

book
Integer Numbers

You might be accustomed to specifying numbers in ways such as:

  • 1,000,000 (with commas);
  • 1 000 000 (with spaces).

However, Python will not understand this.😢

These formats are understandable for a person but not for a computer, so the right way is 1000000 without commas or spaces.

Tarefa
test

Swipe to begin your solution

Here is the distance from the sun to the Earth in miles: var1 = 91,400,000. And here is the distance from the Earth to the moon: var2 = 238 855. You need to adjust these number formats to be compatible with Python.

Rewrite the values of these two distances so they are recognizable by Python.

Solução

Note

If you have a strong desire to use separators, Python understands the following syntax: var = 1_000_000.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 3
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt