Can you guys help me with this program.
I know the answer is 10:
I Just need help putting it in Python. Here's what I have so far:

It specifically wants a loop, well I haven't read the chapters that deal with loops yet so if you won't want to help me until then, I understand.
Edit: The answer was actually 25 52... I misunderstood what was meant by mirror.
Edited by BizzareRide - 2/8/12 at 2:38am
Quote:
2-Digit Mirror
Given:
What is the smallest number, which, when multiplied by 2, and 2 added to the project, has its digits
reversed?
That is:
if A is a digit between 0 and 9, and if B is a digit between 0 and 9,
2*(AB)+2=BA
Find:
Use a for loop that goes from a range of 10 to 50.
Print out the value of the loop, and the value of the loop times 2 plus 2 on the same line.
Print out the value of the difference BA-AB on this same line.
Add an if statement to identify the correct pairing based on the value of the difference.
Write your own unique text message to identify the correct pairing of numbers.
Given:
What is the smallest number, which, when multiplied by 2, and 2 added to the project, has its digits
reversed?
That is:
if A is a digit between 0 and 9, and if B is a digit between 0 and 9,
2*(AB)+2=BA
Find:
Use a for loop that goes from a range of 10 to 50.
Print out the value of the loop, and the value of the loop times 2 plus 2 on the same line.
Print out the value of the difference BA-AB on this same line.
Add an if statement to identify the correct pairing based on the value of the difference.
Write your own unique text message to identify the correct pairing of numbers.
I know the answer is 10:
Quote:
Given:
A =1
B=0
AB=10
2*10+2=22
A=2
B=2
AB = 22
BA = 22
A =1
B=0
AB=10
2*10+2=22
A=2
B=2
AB = 22
BA = 22
I Just need help putting it in Python. Here's what I have so far:
Code:
range (10,50)
for (a=1)

It specifically wants a loop, well I haven't read the chapters that deal with loops yet so if you won't want to help me until then, I understand.
Edit: The answer was actually 25 52... I misunderstood what was meant by mirror.
Edited by BizzareRide - 2/8/12 at 2:38am










