The structure of a program is defined by its control flow. It is built from blocks of code, where each block has a single entry and a single exit point in the control flow.
The typical structure of a python program include 3 parts
Import statements
// import statements are used to include library files to the python program
Function definitions
//This section include the definitions of various functions written in a Python Program
Program statements
// This section include the set of statements for solving the given problem.
Example:
#import module statement import math #function definition statements def findarea(r): area=math.pi * r * r print("Area of circle is : " , area) #programming statements r=int(input("enter radius of circle")) findarea(r)
Output is:
enter radius of circle7 Area of circle is : 153.93804002589985