n=int(input("Please enter any number: ")) a=list(map(int,str(n))) b=list(map(lambda x:x**3,a)) if(sum(b)==n): print("The number is an armstrong number ") else: print("The number is not an arsmtrong number ") Output 1: Please enter any number: 31 The number is not an arsmtrong number Output 2: Please enter any number: 371 The number is an armstrong number
इन्हें भी देखें।
- while loop
- for loop
- nested loops
- loop control statements (Break, Continue, Pass)
- if statement
- if-else statement
- if-elif statement
- nested if statement
- range() function
- keywords
- Identifiers (names)
- Literals
- Operators
- punctuatorts
Python Programs के लिये यहाँ click करें।