print sum([x * (x - 1) for x in [y * y for y in xrange(3,11)]])
Code: Select all
for($y=3;$y<=11;$y++){
$x[]=$y*$y;
}
foreach($x as $i){
$a+=$i*($i-1);
}
echo $i;
print sum([x * (x - 1) for x in [y * y for y in xrange(3,11)]])
Code: Select all
for($y=3;$y<=11;$y++){
$x[]=$y*$y;
}
foreach($x as $i){
$a+=$i*($i-1);
}
echo $i;