Answer:
The solution code is written in Python 3:
- num = 11
-
- while(num <=88):
- firstDigit = num // 10
- secondDigit = num % 10
-
- if(firstDigit == secondDigit):
- print(num)
-
- num += 1
Step-by-step explanation:
Firstly, create a variable, num, to hold the starting value, 11 (Line 1)
Create a while loop and set the loop condition to continue the loop while num smaller or equal to 88 (Line 3).
Within the loop, we can use // to perform the floor division and get the first digit of the num. We use modulo operator % to get the second digit of the num. (Line 4 - 5)
If the firstDigit is equal to secondDigit, print the number (Line 7 -8). Lastly, increment the num by one and proceed to next iteration (Line 10).