Python Program for armstrong numbers | Python Programming Practice For Interview

preview_player
Показать описание
Python Program for armstrong numbers | Python Programming Practice For Interview
This video is part of python tutorial for beginners in hindi.In this video,i have explained Python Program to print armstrong numbers between 1 to 1000.Let's write the program...
you will learn:-
1) Python Program for armstrong numbers
2) python programming

source code :-

About Python Tutorial:- python for beginners-Go from Zero to Hero in python.This tutorial includes python programming videos from basics to advanced

More tutorials:-

About codeyug :-
Codeyug provides tutorials for building your programming skills.Here,you will learn various programming languages,computer science,web development with free of cost.

SHARE | SUBSCRIBE | LIKE
-- - - - - - - - - - - - - - - - - -Thanks for watching this video - - - - - - - - - - - - - - - - - -- -
Our social links:-
creator:-
$ -shantanu kejkar -$

#python #python3 #programming #codeyug #tutorial #beginners #coding
Рекомендации по теме
Комментарии
Автор

this is the best method and very simple method it really make a program very short. 😇😇😇😇😇😇

oliverqueen
Автор

Plz do video on inverted w hollow pattern

kodarajesh
Автор

Bro, could you explain about use of i=str(i).

HUMAN-
Автор

'''
Armstrong Number Checking Algorithm
by Bishal jaiswal Copyright (c) 2022
'''

# 53 ---> sum of nth power of the digits ( [ 5^2+3^2 = 25+9 ] = 34 not armstrong number )

def checkArmstrong(n:int) ->bool:
if n>=0:
myString = str(n)
power = len(myString)
nList = []
ArmstrongNumber = 0

for ch in myString:
integer = int(ch)**power
nList.append(integer)
for i in range(len(nList)):
ArmstrongNumber += int(nList[i])

if ArmstrongNumber == n:
return True
else:
return False

else:
return None

print(checkArmstrong(-1))

sakalagamingyt