Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Code ###
- '''
- Project Euler Problem 001
- '''
- def sumofap(N, A, D):
- """
- The sum function to add terms of an AP.
- """
- return ((N / 2)*(2 * A + (N - 1) * D))
- x = sumofap(333.0, 3.0, 3.0)
- y = sumofap(199.0, 5.0, 5.0)
- z = sumofap(66.0, 15.0, 15.0)
- print "The required answer is ", (x + y - z)
- ### Report ###
- C: 5:sumofap: Invalid name "N" (should match [a-z_][a-z0-9_]{2,30}$)
- C: 5:sumofap: Invalid name "A" (should match [a-z_][a-z0-9_]{2,30}$)
- C: 5:sumofap: Invalid name "D" (should match [a-z_][a-z0-9_]{2,30}$)
- C: 5:sumofap: Invalid name "N" (should match [a-z_][a-z0-9_]{2,30}$)
- C: 5:sumofap: Invalid name "A" (should match [a-z_][a-z0-9_]{2,30}$)
- C: 5:sumofap: Invalid name "D" (should match [a-z_][a-z0-9_]{2,30}$)
- C: 11: Invalid name "x" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
- C: 12: Invalid name "y" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
- C: 13: Invalid name "z" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
Add Comment
Please, Sign In to add comment