Question: 8 . Consider the following code in the file my _ code.py a directory named mypackage with _ _ init _ py . def print

8. Consider the following code in the file my_ code.py a directory named mypackage with __ init_py.
def print_hello():|
print("Hello'")|
Which of the following two statements are the right ways to access the function in the method?
from mypackage.my_code import print_hello
print_hello ()
import my_code
print_hello (
from mypackage import print_hello
print_hello ()
_ from mypackage import my_code
my_ code.print_hello (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!