forked from SENATOROVAI/git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_1.py
More file actions
40 lines (28 loc) · 670 Bytes
/
code_1.py
File metadata and controls
40 lines (28 loc) · 670 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
35
36
37
38
39
40
def round_value(x):
"""Round value.
Args:
x (float): value
Returns:
float: result
"""
return round(x, 2)
def generateReport(x_list):
"""Generate report. Define whether x in list >= 0.
Args:
x_list (list): list of x value. type: float
Returns:
list: result
"""
report = []
for i in range(0, len(x_list)):
x = x_list[i]
result = False
if x >= 0:
result = True
report.append(result)
return report
if __name__ == "__main__":
print(str(round_value(100.2345)))
x_list = [-1, 1]
report = generateReport(x_list)
print(report)