A line that prints just from importing
Predict the output · Medium · §12.4 Making your own module
The likekit.py below is in the same folder. You run code that imports this module. Predict the output.
Code
import likekit
print("Start")
print(likekit.rate(30, 120))
print(__name__)File likekit.py
print("likekit loaded")
def rate(likes, views):
return round(likes / views * 100, 1)
if __name__ == "__main__":
print("Test:", rate(3, 4))Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.