forked from thecount12/rapidpythonprogramming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_program.py
More file actions
34 lines (25 loc) · 698 Bytes
/
basic_program.py
File metadata and controls
34 lines (25 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
basic program to test
"""
class Basic(object):
def __init__(self, num_1, num_2):
self.number_1 = num_1
self.number_2 = num_2
def multiply(self):
return self.number_1 * self.number_2
def add(self):
return self.number_2 + self.number_1
def report(self):
return "hello world"
def combine(self):
data = self.add()
comb = self.add() + self.multiply()
my_string = (f"data addtion: {data}")
my_list = [data, comb, my_string]
return tuple(my_list)
if __name__ == "__main__":
foo = Basic(2, 3)
print(foo.multiply())
print(foo.add())
print(foo.report())
print(foo.combine())