Ejemplo n.º 1
0
 def test_sum_fail(self):
     self.assertFalse(sum.sum(4, 5) == 8)
Ejemplo n.º 2
0
import time
from rta import rta
from sum import sum
from button import button
from scene import scene


sum = sum()
button = button()
rta = rta()
scene = scene()

score = 0

while True:
	if scene.pressStart(rta, button) == True:
		break

for x in range(0, 3):
	
	# Clear the board
	rta.codeBig("JYM01")
	time.sleep(1)
	
	clickIn = 0
	answer = ""
	answerbit = ""	

	current = x
	som = sum.createSum()
Ejemplo n.º 3
0
 def test_sum(self):
     self.assertEqual(sum.sum(4, 5), 9)
Ejemplo n.º 4
0
 def test_fail(self):
     self.assertTrue(sum.sum(8, 9), 17)
Ejemplo n.º 5
0
import time
from numpy import arange

# Use larger array for numpy/cython than for python
# because the pytohn version is so slow...
a= arange(1.e6)

print 'elements:', len(a)

t1 = time.time()
res = sum(a)
t2 = time.time()
print 'python sum(approx sec, result):', (t2-t1)*10, res

a= arange(1.e7)
t1 = time.time()
res = a.sum()
t2 = time.time()
print 'numpy sum(sec, result):', t2-t1, res

from sum import sum
t1 = time.time()
res = sum(a)
t2 = time.time()
print 'cython sum(sec, result):', t2-t1, res
Ejemplo n.º 6
0
 def test_sum01(self):
     self.assertEqual(1, sum(0, 1))
Ejemplo n.º 7
0
 def test_sum10(self):
     self.assertTrue(1 == sum(1, 0))