View Single Post
Old Dec 10th, 2005, 7:48 AM   #2
Klipt
Hobbyist Programmer
 
Join Date: Dec 2005
Posts: 118
Rep Power: 0 Klipt is an unknown quantity at this point
If you import math and use math.pi instead of 3.14 you'll get a more accurate result.

I think it's considered good practice to put the code for your main program into a function called main() and call that. Makes it easier to say things like:

if __name__ == '__main__':
    main()

If you don't want that part to run when you import the file just to use its calculation functions, for example.
Klipt is offline   Reply With Quote