Exemple #1
0
 def test_add_strings(self):
     """
     Test the addition of two strings returns the two string as one
     concatenated string
     """
     result = my_math.add('abc', 'def')
     self.assertEqual(result, 'abcdef')
Exemple #2
0
 def test_add_integers(self):
     """
     Test that the addition of two integers returns the correct total
     """
     result = my_math.add(1, 2)
     self.assertEqual(result, 3)
Exemple #3
0
import my_math

my_math.add(5, 2)

#when you are using command import, it run also the impotred module.
#How to solve this?
Exemple #4
0
# import my_math;
from my_math import add;

# print(my_math.add(2,4))
print(add(3,4))

from my_math import sub as subtract

from my_math import * as obj;

from my_math import mul, add

print(subtract(2,5))

print("Hello")
def test_add():
    assert my_math.add(7, 3) == 10
    assert my_math.add(7, -1) == 6
    assert my_math.add(4.3, 5.3) == 9.6
Exemple #6
0
import my_math

# Call C++ ops.
print(my_math.add(1, 2))
print(my_math.subtract(1, 2))

# Call python op.
print(my_math.multiply(1, 2))
Exemple #7
0
 def test_add_integers(self):
     result = my_math.add(1, 2)
     self.assertEqual(result, 3)
Exemple #8
0
def test_add():
    assert my_math.add(1, 2) == 3
    assert my_math.add(99, 1) == 100
Exemple #9
0
def test_add():
    assert my_math.add(7, 3) == 10
    assert my_math.add(-2, 2) == 0
    assert my_math.add(10, -3) == 7
Exemple #10
0
# this program is used for exercise module

import my_math

print my_math.add(1, 2, 3)

print my_math.sub(10, 9, my_math.add(7, 8))

print my_math.mul(1, 2)
Exemple #11
0
def test_add():  # konwencja nazwa test_nazwafunkcji
    assert my_math.add(7, 3) == 10
    assert my_math.add(7, -1) == 6
    assert my_math.add(4.3, 5.3) == 9.6
Exemple #12
0
def test_add():  # zgrupowanie assercji w funkcji (funkcję trzeba wywołać)
    assert my_math.add(7, 3) == 10
    assert my_math.add(10, 3) == 13
    assert my_math.add(20, 50) == 70
Exemple #13
0
Fichier : b.py Projet : pjh6315/TIL
import a
import my_math
import random

print(my_math.add(5, 6))
print(my_math.mul(2, 64))
import my_math
age = my_math.add(30,5)
height = my_math.subtract(78, 4)
weight = my_math.multiply(90, 2)
iq = my_math.divide(100, 2)
print("Age: %d, height: %d, weight: %d, iq: %d" % (age, height, weight, id))
Exemple #15
0
import a
from my_math import add, mul
#import my_math
#print(my_math.add(2,3))
#print(my_math.mul(2,3))
print(add(2, 3))
print(mul(2, 3))
import random
#컨트롤 누르고 명령어 누르면 상세보기 나옴
Exemple #16
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 13 14:52:52 2018

@author: student
"""
import my_math

if __name__ == '__main__':
    x = input('Enter a number: ')
    y = input('Enter another number: ')
    x = my_math.convert_to_int(x)
    y = my_math.convert_to_int(y)

    print(my_math.add(x, y))
    print("dac_sample_prog", __name__)
Exemple #17
0
import my_math

sum = my_math.add(5, 10)
print('age: %d' % (sum))
Exemple #18
0
def test_add():  # test jednostkowy
    assert my_math.add(4, 5) == 20
    assert my_math.add(6, 6) == 12
    assert my_math.add(6, 7) == 13
import my_math
a = 5
b = 8
c = my_math.add(a, b)
print(c)
Exemple #20
0
def test_add():
	expected = 7
	ret = math.add(2, 5)
	assert ret == expected
Exemple #21
0
 def test_add_floats(self):
     result = my_math.add(10.5, 2)
     self.assertEqual(result, 12.5)
Exemple #22
0
def test_add2():
	expected = -3
	ret = math.add(2, -5)
	assert ret == expected
Exemple #23
0
Fichier : b.py Projet : sgmpy/TIL
import a
import my_math

print(my_math.add(2, 3))
print(my_math.mul(2, 3))
Exemple #24
0
 def test_add_floats(self):
     """
     Test that the addition of two floats returns the correct result
     """
     result = my_math.add(10.5, 2.0)
     self.assertEqual(result, 12.5)
Exemple #25
0
from my_math import add
age = add(30, 5)
print(" Tuoi:", age)


	def testxxx(self):
		total =my_math.add(1,2)
		self.assertEqual(total,3)