Guest User

Untitled

a guest
Nov 23rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. ### Code ###
  2. '''
  3. Project Euler Problem 001
  4. '''
  5.  
  6. def sumofap(N, A, D):
  7. """
  8. The sum function to add terms of an AP.
  9. """
  10. return ((N / 2)*(2 * A + (N - 1) * D))
  11.  
  12. x = sumofap(333.0, 3.0, 3.0)
  13. y = sumofap(199.0, 5.0, 5.0)
  14. z = sumofap(66.0, 15.0, 15.0)
  15. print "The required answer is ", (x + y - z)
  16.  
  17. ### Report ###
  18. C: 5:sumofap: Invalid name "N" (should match [a-z_][a-z0-9_]{2,30}$)
  19. C: 5:sumofap: Invalid name "A" (should match [a-z_][a-z0-9_]{2,30}$)
  20. C: 5:sumofap: Invalid name "D" (should match [a-z_][a-z0-9_]{2,30}$)
  21. C: 5:sumofap: Invalid name "N" (should match [a-z_][a-z0-9_]{2,30}$)
  22. C: 5:sumofap: Invalid name "A" (should match [a-z_][a-z0-9_]{2,30}$)
  23. C: 5:sumofap: Invalid name "D" (should match [a-z_][a-z0-9_]{2,30}$)
  24. C: 11: Invalid name "x" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
  25. C: 12: Invalid name "y" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
  26. C: 13: Invalid name "z" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
Add Comment
Please, Sign In to add comment