kairproject / practice_collaboration Goto Github PK
View Code? Open in Web Editor NEWpractice collaboration with a simple calculator example.
practice collaboration with a simple calculator example.
implement an sub
method
the method receives two float inputs and output is subtraction result of first input to second input as float
implement a test for sub
method
test will be done on the implemented script
Example)
calc=Calculator()
#two float inputs
a=2.0
b=2.0
assert calc.sub(a,b) == 0.0
>>> Passed
The base files will be working as simple guidance for future collaboration.
1. calculator.py
2. test_calculator.py
In calculator.py, implement 'div()', a divide function. This function is given two numbers float type a, b and returns float type a/b. Test will be in 'test_calculator.py'
example
cal = Calculator()
result = cal.div(4.2, 2.1)
assert result == 2.
This test will pass.
cal = Calculator()
result = cal.div(4.2, 2.1)
assert result == 3.
This test will fail.
Make subtract function for calculator.
Takes two float input and returns float output result of subtraction of first input to second input.
Implement 'sub()' in class Calculator, 'calculator.py'.
Test will be in 'test_calculator.py'
like
cal=Calculator()
float result = cal.sub(float a, float b)
example:
cal = Calculator()
result =cal.sub(2,2)
assert result ==0
it will pass the test
We will make a mul function
#input can be any real number
x = 2.0 # real number
y = 1.1 # real number
#body will multiply this two of values.
x * y = 2.2 # output : real number
test code
assert calc.mul(x, y) == 2.2
we will test ten of gugudan examples
implement an add
method
the method receives two real-valued inputs and outputs a sum of the two
implement a test for add
method
test will be done on the implemented script
Example)
calc = Calculator()
# input can be any real number
x = 1.0
y = 1.0
assert calc.add(x, y) == 2.0
print ("Passed")
>>> Passed
Remote feature branches for add, sub, mul, and div respectively.
Two people will work together on a single feature branch; one implements and another makes test cases.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.