Números Inteiros
Você pode estar acostumado a especificar números das seguintes como:
1,000,000
(com vírgulas) ou
1 000 000
(com espaços);
no entanto, o Python não vai entender isso.😢 Esses formatos são compreensíveis para uma pessoa, mas não para um computador, então a maneira correta é 1000000
sem vírgulas ou espaços.
Tarefa
Swipe to start coding
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.
- Output these variables by including their names in
print
function calls.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 3