A = int(input())
B = int(input())
for num in range(A, B + 1):
# order of number
order = len(str(num))
# initialize sum
sum = 0
temp = num
while temp > 0:
digit = temp % 10
sum += digit ** order
temp //= 10
if num == sum:
print(num)In this python program it has two test cases, in this two test cases one test case was getting expected output and second test case are not getting expected output. Please give me expexted output for two test cases. Thank you !
Hints:
Sample Input 1
150
200
Sample Output 1
153
Sample Input 2
1
3
Sample Output 2
1 2 3
Product of the Given Numbers
Given an integer using WHILE LOOP
The first line of input is a positive integer,
The output should be the product of the given input integers.
In the given example,
N = 3 and the input integers are 2, 3, and 7.So, the output should be 2 x 3 x 7 = 42
The first line of input is an integer
In the example, the given starting number is
10, and the number of rows in the pyramid is 5.So, the output should be
10
11 12
13 14 15
16 17 18 19
20 21 22 23 24
Diamond Crystal
This Program name is Diamond Crystal. Write a Python program to Diamond Crystal, it has two test cases
The below link contains Diamond Crystal question, explanation and test cases
https://docs.google.com/document/d/1sVH8M0vCCSky84V1PkWD-eKm1v0dPRC5/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Maximum
This Program name is Maximum. Write a Python program to Maximum, it has two test cases
The below link contains Maximum question, explanation and test cases
https://docs.google.com/document/d/1z0yr9wfjkiTADlYer1IJgNn2w8x3_HJG/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Hyphenate Letters
This Program name is Hyphenate Letters. Write a Python program to Hyphenate Letters, it has two test cases
The below link contains Hyphenate Letters question, explanation and test cases
https://docs.google.com/document/d/1IrqSpmObeTn85U5gmkMV7IEwgDVYmfvg/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Roots of a quadratic equation
This Program name is Roots of a quadratic equation. Write a Python program to Roots of a quadratic equation, it has two test cases
The below link contains Roots of a quadratic equation question, explanation and test cases
https://docs.google.com/document/d/1Wz9yIZ4GQON9tJEmSTAbcMunwn95k5PB/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Diamond
This Program name is Diamond. Write a Python program to Diamond, it has two test cases
The below link contains Diamond question, explanation and test cases
https://docs.google.com/document/d/1LtfuUk5t1IPGh6yCOoJ2Tm3AZFZnVb1W/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run
Sum of N terms in Harmonic series
This Program name is Sum of N terms in Harmonic series. Write a Python program to Sum of N terms in Harmonic series, it has two test cases
The below link contains Sum of N terms in Harmonic series question, explanation and test cases
https://docs.google.com/document/d/1kZEEzRlzAo_HT0I9HineNAMs_3PwlU2_/edit?usp=sharing&ouid=104486799211107564921&rtpof=true&sd=true
We need exact output when the code was run