Math
Number
  1. #!/usr/bin/python
  2. import math
  3.  
  4. #ceil
  5. print math.ceil(3.14);
  6.  
  7. #fabs, replace abs
  8. print math.fabs(-3.14);
  9.  
  10. #factorial
  11. print math.factorial(10);
  12.  
  13. #floor
  14. print math.floor(3.14);
  15.  
  16. #fmod, replace %
  17. print math.fmod(10, 3);
  18.  
  19. #fsum, replace sum
  20. print math.fsum(range(10));
  21.  
  22. #round, is not a function of math module
  23. print round(3.14, 1);
  24.  
  25. #trunc
  26. print math.trunc(3.14);
Power and Log
  1. #!/usr/bin/python
  2. import math
  3.  
  4. #exp
  5. print math.exp(2);
  6.  
  7. #log
  8. print math.log(100, 10);
  9.  
  10. #pow
  11. print math.pow(10, 2);
  12.  
  13. #sqrt
  14. print math.sqrt(100);
Angle
  1. #!/usr/bin/python
  2. import math
  3.  
  4. #exp
  5. print math.exp(2);
  6.  
  7. #log
  8. print math.log(100, 10);
  9.  
  10. #pow
  11. print math.pow(10, 2);
  12.  
  13. #sqrt
  14. print math.sqrt(100);
Constants
  1. #!/usr/bin/python
  2. import math
  3.  
  4. #pi
  5. print math.pi;
  6.  
  7. #e
  8. print math.e;
Reference