The digits 0, 1, and 8 look much the same if rotated 180 degrees on the page (turned

upside down). Also, the digit 6 looks much like a 9, and vice versa, when rotated 180
degrees on the page. A multi-digit number may also look like itself when rotated on the
page; for example 9966 and 10801 do, but 999 and 1234 do not.
You are to write a program to count how many numbers from a given interval look like
themselves when rotated 180 degrees on the page. For example, in the interval [1..100]
there are six : 1, 8, 11, 69, 88, and 96.
Your program should take as input two integers, m and n, which define the interval to be
checked, 1 ≤ m ≤ n ≤ 32000. The output from your program is the number of rotatable
numbers in the interval.
You may assume that all input is valid.
Input/output is not from/to files for this question. Keyboard input and screen output is
expected.
Sample Session User input is in italics.
Enter the lower bound of the interval:
1
Enter the upper bound of the interval:
100
The number of rotatable numbers is:
6

I am kind of stuck withe logic... help me please.

Yes .... Quadrature PSK or QPSK has a menu of 4 phases (45, 135, 225 & 315 degrees), where two bits designate each symbol. 8PSK, 16PSK, . . . 256PSK are also in use.

To solve this problem, you need to iterate through each number in the given interval and check if it looks like itself when rotated 180 degrees.

Here's a step-by-step approach to implement the logic:

1. Prompt the user to enter the lower and upper bounds of the interval.
2. Read the input values and store them in variables, let's call them 'lower' and 'upper'.
3. Initialize a variable 'count' to keep track of the number of rotatable numbers, set it to 0.
4. Iterate through each number in the interval, starting from 'lower' and ending at 'upper'.
5. For each number, convert it to a string and check if it contains any digits that are not rotatable (e.g., 2, 3, 4, 5, 7).
6. If the number contains any non-rotatable digits, skip it and move to the next number in the interval.
7. If the number contains only rotatable digits (0, 1, 6, 8, 9), check if it looks the same when rotated 180 degrees.
- You can do this by reversing the string and checking if it is equal to the original string.
8. If the number looks like itself when rotated, increment the 'count' variable by 1.
9. After iterating through all the numbers in the interval, display the value of 'count' as the number of rotatable numbers.

Here's a Python code snippet that implements the above logic:

```python
lower = int(input("Enter the lower bound of the interval: "))
upper = int(input("Enter the upper bound of the interval: "))

count = 0
for num in range(lower, upper+1):
num_str = str(num)

if any(char in num_str for char in ['2', '3', '4', '5', '7']):
continue

if num_str == num_str[::-1]:
count += 1

print("The number of rotatable numbers is:", count)
```

I hope this helps! Let me know if you have any further questions.