I have to create a function that prints the palindromes between two numbers, this is what I have so far:
for i in range(n,m):
can anyone assist?
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
what is this for? c++, c, java?
It's Python and the above code does this.
It just sets i to 0, gets the modulus of 0/10 so dig is 0, then takes rev and multiplies it by ten and adds 0 to it which will create an error if rev wasn't defined elsewhere. let's pretend it was set to 0 elsewhere, so 0*10+0 is 0. Then you divide i by 10, since i was never changed it's still 0 so we make it 0 again. It repeats this process a number of times equal to the difference of m and n. And then we print 0 (well, actually we don't because based on the indentation it is outside the function and therefore doesn't know what i is so just gives us an error).
Not sure what you thought you were doing here nor do I understand what you mean by "prints the palindromes between two numbers". Normally something like 'isPalindrome' would simply return true if the item is a palindrome and false if it is not. But then the function only needs 1 argument and not two. With two arguments maybe you are trying to see if one is the reverse of the other, hard to say.
You will need to explain what you mean a little better and provide sample input/output.
This is what the program is supposed to look like:
Enter the starting point N: 200
Enter the ending point M: 800
The palindrome numbers are: 313
Not the answer you are looking for? Search for more explanations.
Something like this should work
for i in range(m,n):
for i in range(n,m):
n= eval(input("Enter the starting point N:\n"))
m=eval(input("Enter the ending point M:\n"))