Python program to find Palindrome
This python example script will help you to find out the entered string is a palindrome or not. The logic is reversing the original string and comparing both the original and reversed string. Here is...
View ArticlePython program to find Armstrong number
In this Python example you are going to learn how to find a number is an Armstrong number or not. An “Armstrong number” is a number that is equal to the sum of the nth powers of its individual digits....
View ArticlePython program to convert Fahrenheit to Celsius
In this lesson you are going to learn how to convert Fahrenheit to Celsius by using Python script, I’m following Python 3 syntax to write programs which actually works in both Python 2 and Python 3....
View ArticleReverse a string without using build in method [::-1] in Python
If you are new to Python and you don’t know how to reverse a string in Python, here is a sample script using default reverse method [::-1]:print ("Enter a String") mystr = input() #reverse using...
View ArticleCalculate hours, minutes between two times in Python
I’m basically a PHP developer, but there was a situation where I have to work with a Python script, you know what? I have to find hours between two times, but that was not so easy for me. Even I...
View ArticleRead a file in Python and find number of Lines
Reading a file in Python is very simple, In this tutorial you are going to see how to read a file as well as count the number of lines in a text file in Python. See the code here:f = open('myfile.txt')...
View ArticlePython Factorial Program
This is a basic Python program which helps school and college students to improve their knowledge in Python. If you don’t know what is factorial, here is a small explanation, Multiplying given integer...
View ArticleHow to get Unix Timestamp in Python
To print timestamp in Python is very simple, all you have to do is, import the time library and call the time() function to get the timestamp. But the problem most of us facing is where it will return...
View ArticlePython program to find prime number or not!
Hello people, here I am writing a Python programme after a very long time. This programme could be useful for cracking interviews or could be useful for school / college students who wish to learn the...
View ArticlePython Program to count the number of vowels in a string!
Here is another interesting Python program which will take a word or sentence as an input (basically a string) and return the number of vowels present in it. There are numerous way you can write a...
View ArticlePython program to find Odd or Even number!
Hello reader, here is a Python programme to find an entered number is odd or even. This programme could be useful for cracking interviews or could be useful for school / college students who wish to...
View ArticlePython program to print Diamond Star pattern!
In this post, I am going to write a python script to print Diamond Star Pattern. I am writing this program in Python 3 version. And, It’s a python console program to print a diamond star pattern. So...
View ArticlePython program to find Largest & Smallest number in a list
In this post, we are going to write a simple Python script to find the largest and the smallest number in a list. It is really simple to find the largest and smallest number in a list using Python...
View ArticlePython program to find the sum of array
Let’s write a simple python program to find the sum of an array. It’s very simple to calculate the sum of an array in Python, you just have to use a python function called sum(). Here is the example...
View ArticlePython program to print leap years between two given years
Dear Reader, In this post I am going to write a core Python program to print Leap years!. First, we will get the start and end year from the user and then print the leap years between the start and the...
View ArticlePython Program to print Random Numbers
In this post, let’s write a simple Python program to print random numbers. To print random numbers it’s very simple in Python as it has a random package available in the Python core itself. Here is the...
View ArticlePython Program to print Prime numbers
In this post, I am going to write a simple Python 3 program to print the Prime numbers within a limit. Firstly, Let me explain what is a prime number. If you don’t know what is a prime number, here is...
View ArticlePython – Print Alphabets Uppercase & Lowercase
This post explains how to print English Alphabets in both Uppercase & Lowercase using core Python. Below is the ASCII values to print Alphabets, Alphabets in Uppercase ASCII range: 65 to 90...
View ArticlePython program to convert UPPERCASE to lowercase
In this post, I am going to write a very simple Python program to convert an UPPERCASE string to lowercase. Without wasting our time, let’s write the program now, I am going to use Python 3 syntax for...
View ArticlePython program to convert Kilometer to Miles
In this post, we are going to see how to convert Kms to Miles using a simple Python script. The formula for converting Kilometer to Miles is very simple, just dividing the value by 1.609. Let’s write...
View Article