Category Archives: Python Programs using User Defined Functions

Python Program Binary Search

Python Program Binary Search – In this program, a sorted list is given and a target item to be searched in the list.   Source Code of Python Binary Search Program binary_search(arr, target): left, right = 0, len(arr) – 1 while left

Python Convert Millimeters to Inches using Function

Python Convert Millimeters to Inches using function – This Python program will input millimeters  from the user. It will convert mm into inches. The Formula To Convert mm into Inches To convert millimeters into inches, Multiply millimeters by 0.0393701 or divide millimeters by 25.4. Source Code – Python Function To Convert mm to Inches #Python… Read More »

Python Find Area of Circle using User Defined Function

Topic: Python Find Area of Circle using User Defined Function The area of a circle is given by the formula: area = PI x R2 where PI is the popular math constant = 3.14159 and R is the radius of the circle. We will use the math module in this Python program. Import math module… Read More »

Python Print Birthday Poem Program

Python Print Birthday Poem Program for printing the popular happy birthday poem to a specific person. This Python program uses a user defined function print_birthday_poem(person_name). This function takes a person name as parameter and prints happy birthday poem for him / her. The main function will ask the input that is the birthday person’s name.… Read More »

Python Multiplication Table of Number by Function Program

Python Multiplication Table of Number by Function Program # An example Python program # to define and call a function table # to show multiplication table of a number # Author : www.EasyCodebook.com (c) # Note the first line in function is called # document string, it # define the function with formal parameter num… Read More »