예제 #1
0
 def test_add(self):
     result = mycalc.add(10, 5)
     self.assertEqual(result, 15)
     self.assertEqual(mycalc.add(10, 1), 11)
예제 #2
0
import mycalc
print(mycalc.add(19, 23))
예제 #3
0
from mycalc import add
print(add(2, 3))  # 5

from mymath import add
print(add(2, 3))  # 6

from mycalc import add
print(add(2, 3))  # 5
예제 #4
0
# this is an script of python calculator
# create a file named calc.py
# then run the function and see
from mycalc import add, sub, mul, div

a, b = list(map(int, input("Enter the value of a and b ").split()))

print(add(a, b))
print(sub(a, b))
print(mul(a, b))
print(div(a, b))
import mycalc
print(mycalc.add(2, 3))  # 5

import mymath
print(mymath.add(2, 3))  # 6

import mycalc
print(mycalc.add(2, 3))  # 5
예제 #6
0
 def test_add(self):
     self.assertEqual(mycalc.add(1, 2), 3)
예제 #7
0
파일: hello.py 프로젝트: tsubone/test2
#!/usr/bin/env python

import datetime
import math
import sys
import mycalc as hoho
from mycalc import add
#import enum
import sets

print "hoho.add=", hoho.add(1,2)
print "add=", add(1,2)

def squre (n):
    return n*n

class FirstClass:
    a = "hello"
    def m(self):
        print FirstClass.a
        

print "Hello world\n"

print 2

print squre (2)

#FirstClass.a

#FirstClass.m