Telegram Group & Telegram Channel
🎓 Задача по Python #44

Описание


Напишите программу, которая проверяет, является ли число числом Армстронга.

Число Армстронга — натуральное число, которое в данной системе счисления равно сумме своих цифр, возведённых в степень, равную количеству его цифр.

Пример:


3**3 + 7**3 + 1**3 = 371

Решение:

def armstrong_number(num):
sum = 0
length = len(str(num))
for digit in list(str(num)):
sum += int(digit)**length
return sum == num


Свой вариант решения в комментарии 💬

#задачи



tg-me.com/pythonturboru/556
Create:
Last Update:

🎓 Задача по Python #44

Описание


Напишите программу, которая проверяет, является ли число числом Армстронга.

Число Армстронга — натуральное число, которое в данной системе счисления равно сумме своих цифр, возведённых в степень, равную количеству его цифр.

Пример:


3**3 + 7**3 + 1**3 = 371

Решение:

def armstrong_number(num):
sum = 0
length = len(str(num))
for digit in list(str(num)):
sum += int(digit)**length
return sum == num


Свой вариант решения в комментарии 💬

#задачи

BY Python Turbo. Уютное сообщество Python разработчиков.




Share with your friend now:
tg-me.com/pythonturboru/556

View MORE
Open in Telegram


Python Turbo Уютное сообщество Python разработчиков Telegram | DID YOU KNOW?

Date: |

How To Find Channels On Telegram?

There are multiple ways you can search for Telegram channels. One of the methods is really logical and you should all know it by now. We’re talking about using Telegram’s native search option. Make sure to download Telegram from the official website or update it to the latest version, using this link. Once you’ve installed Telegram, you can simply open the app and use the search bar. Tap on the magnifier icon and search for a channel that might interest you (e.g. Marvel comics). Even though this is the easiest method for searching Telegram channels, it isn’t the best one. This method is limited because it shows you only a couple of results per search.

Telegram Gives Up On Crypto Blockchain Project

Durov said on his Telegram channel today that the two and a half year blockchain and crypto project has been put to sleep. Ironically, after leaving Russia because the government wanted his encryption keys to his social media firm, Durov’s cryptocurrency idea lost steam because of a U.S. court. “The technology we created allowed for an open, free, decentralized exchange of value and ideas. TON had the potential to revolutionize how people store and transfer funds and information,” he wrote on his channel. “Unfortunately, a U.S. court stopped TON from happening.”

Python Turbo Уютное сообщество Python разработчиков from es


Telegram Python Turbo. Уютное сообщество Python разработчиков.
FROM USA