Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Integer Numbers | Знайомство з числами в Python
Типи даних у Python
course content

Зміст курсу

Типи даних у Python

Типи даних у Python

1. Знайомство з числами в Python
2. Істина чи брехня?
3. Рядки
4. Поєднання всіх тем разом

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.

Завдання
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.

Рішення

Note

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

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 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.

Завдання
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.

Рішення

Note

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

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 3
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt