Category Archives: Python Programs Using Looping Statements

Python Different Counts in String

Python Different Counts in String – Python program to count uppercase letters, lower case letters, vowels, consonants and spaces in the given string.   #Python program to count upper case letters, lower case letters #vowels, consonants and spaces in a string uppercase=0 lowercase=0 vowels=0 consonants=0 spaces=0 string=input(“Enter a String: “) for ch in string: if… Read More »

 143 total views

Python Program Prime Between Two Numbers

Python Program Prime Between Two Numbers In this Python programming tutorial we shall learn to write and execute a Python program to print all the prime numbers between the two given  numbers. Program statement: Write a Python program to input two numbers and print all the prime numbers between these two numbers. Actually we want… Read More »

 2,025 total views,  4 views today

Python Program Digits Product

In this tutorial we shall learn to write a Python program to print product that is multiplication of digits of a given number. Program statement: Write a program to display product of the digits of a number accepted from the user. How this Python Program Product of digits Works? Dear readers, when we divide a… Read More »

 905 total views,  1 views today

Python Prime Factors Program

Python Prime Factors Program – This Python program will take a number as input from the user. It will display prime factors of that number. We will study prime factors before writing the Python program to find them. Definition of Prime Factor A factor that is a prime number is called a Prime Factor. We… Read More »

 2,542 total views,  2 views today

Use of break and continue in Python with Examples

Topic: Use of break and continue in Python with Examples What is the importance of break and continue Statements in Python with Examples? break Statement in Python In Python programming language, break statement is used to break ( terminate ) the for loop or while loop. As soon as the break statement is executed the… Read More »

 2,874 total views,  1 views today

Python Program To Print a to z using for loop and chr function

Topic: Python Program To Print a to z using for loop and chr() function We will use the built-in Python function chr() to print the small alphabets from a to z. We know that the Ascii code of ‘a’ is 97 and that of ‘z’ is 122. Therefore we will use a range() function in… Read More »

 21,821 total views,  18 views today

Python Sentinel Controlled Loop Example Program

Topic: Python Sentinel Controlled Loop Example Program What is a Sentinel Controlled Loop inPython? A Sentinel Controlled Loop is a loop whose execution depends upon a special value. This sentinal controlled loop is terminated if a special value called sentinel value is encountered. The sentinel controlled loops are conditional loops. For example we can use… Read More »

 9,282 total views,  7 views today

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 »

 30,834 total views,  17 views today

Python GCD Program by Successive Division

Python GCD Program by Successive Division – This Python Programming tutorial will explain the Pthon code to find Greatest Common divisor or HCF. The HCF stands for Highest common factor which is a second name of GCD. This progrram will calculate GCD of two positive inetegers using Improved version of Euclid’s algorithm – Succesive division… Read More »

 2,134 total views

Python GCD Program with for statement

Python GCD Program with for statement – This Programming tutorial will explain a simple logic and Python code to find GCD. A simple for loop statement is used to calculate Greatest common Divisor of the two given numbers. The Source code and Output of Python GCD Program with for statement # Write a Python program… Read More »

 4,057 total views,  1 views today