Category Archives: Python Programs with Functions

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 »

 738 total views,  7 views today

Python Print Star Patterns 14 Programs

Python Print Star Pattern Shapes – In this Python Programming tutorial, we will discuss printing different star patterns, shapes, pyramids, triangles, squares etc using nested for loops. The Program Logic Normally we use nested for loops to print star shapes in Python. For example, the following Python program will need two nested for loops. The… Read More »

 1,822 total views,  57 views today

Python Simple Calculator Program

Python Simple Calculator Program demonstrates a four function basic calculator. This Python program provides the functionalities of:  Addition  Subtraction  Multiplication and  Division of two numbers. Code for Simple Calculator Program # This is a simple Python program # to design a simple 4 function # calculator using if -elif- else # define functions def add(x,… Read More »

 1,356 total views,  2 views today

Python Program Fibonacci Series Function

Topic: Python Program Fibonacci Series Function Write a user defined Fibonacci functin in Python to print the popular Fibonacci series up to the given number n. Here n is passed as an argument to the Fibonacci function and the program will display the Fibonacci series upto the provided number by the user input. What is… Read More »

 1,916 total views,  14 views today

Python Recursive Function Check Palindrom String

Python Recursive Function Check Palindrom String # Write a Python program to # input a string and find # whether the string is a palindrome or not # www.easycodebook.com # Start of the Python program # define the recursive function def is_palindrome(s): if len(s) <= 1: # Base case return True elif s[0] != s[len(s)… Read More »

 640 total views,  3 views today