xxxxxxxxxx
Once, I had a problem I needed to solve, I searched for two days and realised
that if I had searched for 2 minutes in the python documentation I could find
my answer.
Python documentation. Very useful
xxxxxxxxxx
Remember 5 hours of debugging
can save you 5 minutes of readint the documentation
xxxxxxxxxx
for n in range(2, 10):
for x in range(2, n):
if n % x == 0:
print(n, 'equals', x, '*', n//x)
break
else:
# loop fell through without finding a factor
print(n, 'is a prime number')
2 is a prime number
3 is a prime number
4 equals 2 * 2
5 is a prime number
6 equals 2 * 3
7 is a prime number
8 equals 2 * 4
9 equals 3 * 3
xxxxxxxxxx
1
2
3
jQuery.validator.addMethod("math", function(value, element, params) {
return this.optional(element) || value == params[0] + params[1];
}, jQuery.validator.format("Please enter the correct value for {0} + {1}"));