000001 Lecture Notes - Init

8 views1 pages
20 Mar 2023
Department
Course
Professor

Document Summary

A package is a folder containing one or more modules. In addition to that, the folder must contain a special file called __init__. py which is a packaging list. It is necessary for python interpreter to recognise a folder as package. Secondly it offers only specified resources from its modules to be imported. Create a new folder named c:\packageexample and a subfolder in it named as "example" and save following scripts in example folder. Welcome to python tutorial". format(name)) return def bye(name): print ("good bye {}. #area. py def rectangle(w,h): return w*h def circle(r): import math return math. pi*math. pow(r,2) #factorial. py def ifact(x): f=1 for i in range(1, x+1): f=f*i return f def rfact(n): if n == 1: return 1 else: return n * rfact(n-1)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions