Benjamin J. Racine wrote:
Doesn't this work?

round_by_5.py


import sys

def round_by_5(x= sys.argv[0]):
    x = x/5.
    x = round(x)
    x = x*5
    print(x)
return x
Ben R.

I am learning, I got this to work fine;
#!/usr/bin/python

import sys

def round_by_5(x = sys.argv[1]):
    x = int(x)/5
    x = round(x)
    x = x*5
    print int(x)

round_by_5(sys.argv[1])


--
Powered by Gentoo GNU/LINUX
http://www.linuxcrazy.com
pgp.mit.edu

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to