Search:
Type: Posts; User: mrBen
Search:
Search took 0.62 seconds.
-
Doh! I read it as reversing every word that had an odd number of letters......
Amended script:
#!/usr/bin/python
def isEven(number):
-
You forgot to reverse 'whats' in your example....
Here is a Python solution - it's a bit clunky, but it works, and it only took a short while to code.
#!/usr/bin/python
def...
-
Now might be a good time to mention http://www.pythonchallenge.com
-
or:
Python 2.3.5 (#2, May 4 2005, 08:51:39)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> mystring = "She sells seas...
-
Can I just clarify
- the array is of a user defined length - so I need to include a means of him entering the length he wants?
- When you say 'even' distibution, I am assuming you mean in a...
-
Cheers Strike; knew I could rely on you :D
Python Rocks!
-
Another moment to stretch my Python fingers again: (Amendments from Strike to follow ;) )
#!/usr/bin/python
import os, re
inputfile="/home/mrben/input.txt"...
-
OK - this is a 5 minutes Python beginning (I'm at work - don't have any more time). It converts an IP address to a 32bit (unsigned) hex number.
It doesn't convert back yet, but it would take an...
-
Aha!
That worked. :D
I retract all my previous comments.
-
Probably because I'm running it at work under Windows........
-
OK - played the game now. Couple of comments to make:
1. It only accepts a single word, not a whole phrase - if you put in something like 'star wars' it only takes the first word.
2. It...
-
Did anyone post the Python solution to this? It's really neat:
a,b = b,a
Will swap the two :D I was dead impressed when I learnt that (I'm easily pleased)
-
In python range(x) gives you a list from 0 to x.
In Python, your loop / condition ends at the next unindented line. Thus you always have pretty looking code ;)
-
My python attempt:
[code]
x=0
y=0
while y<10000:
y=0
for loop in range(x):
y+=x
print y
|
|