Respuesta :
Answer:
Following are the code to this question:
x = int(input())#defining a variable x for user input value
if(x>=20 and x<=98):#defining an if block that checks value is in between 20 to 98
while(not(x%10==x//10)):#defining while loop that seprate numbers and checks it is not equal
print(x)#print value
x-=1# decrease value by subtracting 1
print(x)# print value
else:#defining else block
print("The input value must lie in 20-98")#print message
Output:
36
36
35
34
33
Explanation:
- In the above python program code, a variable x is declared, which is used to input the value from the user end.
- In the next step, a conditional statement is used in if block, it checks the input value is lie in 20 to 98, and to check its uses and logic date, if it is false it will goto else section in this, it will print a message.
- If the given value is true, inside if block a while loop is declared, that separately divide the value and check it is identical or not, if it is not identical it will print the value and checks its less value similarly.
The program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical is as follows:
x = int(input("your number should be between 20 to 98: "))
while 20 <= x <= 98:
print(x, end='\n')
if x % 11 == 0:
break
x -= 1
else:
print("your number must be between 20 to 98")
Code explanation:
The code is written in python
- The first line of code, we store the users input in the variable x.
- Then while 20 is less than or equal to or less than and equals to the users input, we have to print the x value .
- If the users input divides 11 without remainder(the digit are the same) then we break the loop.
- The loop continue as we subtract one from the users value
- The else statement wants us to tell the user to input numbers between 20 to 98
learn more on python code here: https://brainly.com/question/26104476

