File tree 4 files changed +41
-0
lines changed
W3School-PyExercises/PY-Modules
4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ """
2
+ from PYTHON Modules: Exercise 1 ( https://www.w3schools.com/python/exercise.asp?filename=exercise_modules1 )
3
+
4
+ question:
5
+ What is the correct syntax to import a module named "mymodule"?
6
+
7
+ ______ mymodule
8
+ """
9
+ import mymodule
Original file line number Diff line number Diff line change
1
+ """
2
+ from PYTHON Modules: Exercise 2 ( https://www.w3schools.com/python/exercise.asp?filename=exercise_modules2 )
3
+
4
+ question:
5
+ If you want to refer to a module by using a different name, you can create an alias.
6
+ What is the correct syntax for creating an alias for a module?
7
+
8
+ import mymodule __ mx
9
+ """
10
+ import mymodule as mx
Original file line number Diff line number Diff line change
1
+ """
2
+ from PYTHON Modules: Exercise 3 ( https://www.w3schools.com/python/exercise.asp?filename=exercise_modules3 )
3
+
4
+ question:
5
+ What is the correct syntax of printing all variables and function names of the "mymodule" module?
6
+
7
+ import mymodule
8
+
9
+ print(_____________)
10
+ """
11
+ import mymodule
12
+
13
+ print (dir (mymodule ))
Original file line number Diff line number Diff line change
1
+ """
2
+ from PYTHON Modules: Exercise 4 ( https://www.w3schools.com/python/exercise.asp?filename=exercise_modules4 )
3
+
4
+ question:
5
+ What is the correct syntax of importing only the person1 dictionary of the "mymodule" module?
6
+
7
+ ____ mymodule ______ person1
8
+ """
9
+ from mymodule import person1
You can’t perform that action at this time.
0 commit comments