Skip to content

Commit df3ea71

Browse files
committed
final code for import statements.
1 parent ee7c44f commit df3ea71

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import sys
22
from os import path
33
import statistics as stats
4+
from statistics import median, mean
5+
46
# noinspection PyProtectedMember
57
from ch_06_packages._01_beware_the_trade_imbalance_support import mode
6-
from statistics import mean, median
7-
# Bad: from statistics import *
88

99
print("Current version: {}".format(sys.version_info.major))
1010
print(path.abspath('.'))
1111
print(stats.median([1, 1, 1, 5, 8, 9, 100]))
1212
print(median([1, 1, 1, 5, 8, 9, 100]))
1313
print(mean([1, 1, 1, 5, 8, 9, 100]))
14-
print(mode(42, 7, 7, 1))
14+
print(mode([42, 7, 7, 1]))
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
def mode(*args):
22
if not args:
3-
return 0
3+
print("Mode set to DEFAULT")
4+
return
45

5-
return args[0]
6+
print("Mode set to ADVANCED")

0 commit comments

Comments
 (0)