Skip to content

Commit ee45bf0

Browse files
Update string_import.py
1 parent d778b8f commit ee45bf0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

string_import.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# you can use builtin __import__ function
22

3-
modname = 'string'
3+
modname = 'strings'
44
string = __import__(modname)
5-
print(string)
5+
print(strings)
66

77
# Python official prefferred way
88

99
import importlib
10-
modname = 'string'
11-
string = importlib.import_module(modname)
12-
print(string)
10+
modname = 'strings'
11+
strings = importlib.import_module(modname)
12+
print(strings)

0 commit comments

Comments
 (0)