Day: January 7, 2021

Python Examples for Beginners: Python Code to Find the Factorial of a Number

(Python Tutorials for Citizen Data Scientist) Python Code to Find the Factorial of a Number In this article, you’ll learn to find the factorial of a number and display it. The factorial of a number is the product of all the integers from 1 to that number. For example, the factorial of 6 is 1*2*3*4*5*6 = …

Python Examples for Beginners: Python Code to Check Prime Number

(Python Tutorials for Citizen Data Scientist) Python Code to Check Prime Number Example to check whether an integer is a prime number or not using for loop and if…else statement. If the number is not prime, it’s explained in output why it is not a prime number. A positive integer greater than 1 which has …

Python Examples for Beginners: Python Code to Find the Largest Among Three Numbers

(Python Tutorials for Citizen Data Scientist) Python Code to Find the Largest Among Three Numbers In this program, you’ll learn to find the largest among three numbers using if else and display it. In the program below, the three numbers are stored in num1, num2 and num3 respectively. We’ve used the if…elif…else ladder to find the largest among the three and display …

Python Examples for Beginners: Python Code to Check Leap Year

(Python Tutorials for Citizen Data Scientist) Python Program to Check Leap Year In this program, you will learn to check whether a year is leap year or not. We will use nested if…else to solve this problem. A leap year is exactly divisible by 4 except for century years (years ending with 00). The century …