57 Solved Topics
Remove Filter Now I am looking for the best way to reverse the digits in an integer. For instance x = 12345 should become y = 54321. | |
What is the most efficient way to spell a string in reverse, for instance s = "banana". ![]() | |
If I have an integer like x = 12345, how do I separate that into individual integers 1, 2, 3, 4, 5? | |
With the ease of argument passing to and from functions in Python, why would anyone want to use global variables. Isn't that an open invitation for mistakes to happen? Yet, I see code in threads here that abound with globals. I am a little confused here. | |
How to I best pass multiple arguments to and from a function? | |
I have played with Python code just a little and like it so far. I am using a Windows XP machine and have downloaded Python 2.5. As recommended in the "Starting Python" thread, I am saving my test files in the directory C:\Python25\Atest\. When I bring up the IDLE editor, … | |
I thought function xrange would give me a list of integers, but I got a string instead: [code]x = "xrange(1, 5)" print x # xrange(1, 5) x = xrange(1, 5) print x # xrange(1, 5) same result as string above!? [/code] |
The End.