Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 22463d8

Browse files
Merge pull request #36 from Arpit045-boop/master
Update string_import.py
2 parents d778b8f + ee45bf0 commit 22463d8

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)

AltStyle によって変換されたページ (->オリジナル) /