Python

Print All Integers That Aren’t Divisible By Either 2 Or 3 And Lie Between 1 And 50 In Python.

In this Basic Python Program, we will have a look at how to “print all integers that are not divisible by either 2 or 3” with the help of Python Programming Language. Python Program  To Print All Integers That Aren’t Divisible By Either 2 Or 3 And Lie Between 1 And 50  for i in …

Print All Integers That Aren’t Divisible By Either 2 Or 3 And Lie Between 1 And 50 In Python. Read More »

Check If A Number Is A Palindrome In Python

In this Basic Python Program, we will have a look at how to “check if a number is a palindrome” with the help of Python Programming Language. Python Program To Check If a Number is a Palindrome n=int(input(“Enter number:”)) temp=n rev=0 while(n>0):     dig=n%10     rev=rev*10+dig     n=n//10 if(temp==rev):     print(“The number is a palindrome!”) else:     print(“The number isn’t …

Check If A Number Is A Palindrome In Python Read More »

Count the Number of Digits in a Number in python

In this Basic Python Program, we will have a look at how to “count the number of digits in a number” with the help of Python Programming Language. Python Program To Count Number Of Digits  n=int(input(“Enter number:”)) count=0 while(n>0):     count=count+1     n=n//10 print(“The number of digits in the number are:”,count) In the above program, we counted …

Count the Number of Digits in a Number in python Read More »

Find the Sum of Digits in a Number in python

In this Basic Python Program, we will have a look at How to “Find the sum of digits” with the help of Python Programming Language. Python Program To Find the Smallest Divisor of an integer n=int(input(“Enter an integer:”)) a=[] for i in range(2,n+1):     if(n%i==0):         a.append(i) a.sort() print(“Smallest divisor is:”,a[0]) In the above program, we easily …

Find the Sum of Digits in a Number in python Read More »

Accept Three Digits and Print all Possible Combinations from the Digits in python

In this Basic Python Program, we will have a look at How to “print all the possible combination from the digits” with the help of Python Programming Language. Python Program To Print All Possible Combinations from the Digits a=int(input(“Enter first number:”)) b=int(input(“Enter second number:”)) c=int(input(“Enter third number:”)) d=[] d.append(a) d.append(b) d.append(c) for i in range(0,3): …

Accept Three Digits and Print all Possible Combinations from the Digits in python Read More »

Read Two Numbers and Print Their Quotient and Remainder in python

In this Basic Python Program, we will have a look at How to “read two numbers and print their quotient & remainders” with the help of Python Programming Language. Python Program To Read Two Numbers and Print Their Quotient and Remainder a=int(input(“Enter the first number: “)) b=int(input(“Enter the second number: “)) quotient=a//b remainder=a%b print(“Quotient is:”,quotient) …

Read Two Numbers and Print Their Quotient and Remainder in python Read More »

Print all Numbers in a Range Divisible by a Given Number in python

In this Basic Python Program, we will have a look at How to “Print all numbers in a range divisible by a given number” with the help of Python Programming Language. Python Program to Print All Numbers In A Range Divisible By a Given Number lower=int(input(“Enter lower range limit:”)) upper=int(input(“Enter upper range limit:”)) n=int(input(“Enter the …

Print all Numbers in a Range Divisible by a Given Number in python Read More »

Read Two Numbers and Print Their Quotient and Remainder in python

In this Basic Python Program, we will have a look at how read Two Numbers and Print Their Quotient and Remainder in python. Python program to read Two Numbers and Print Their Quotient and Remainder a=int(input(“Enter the first number: “)) b=int(input(“Enter the second number: “)) quotient=a//b remainder=a%b print(“Quotient is:”,quotient) print(“Remainder is:”,remainder) Output: Enter the first …

Read Two Numbers and Print Their Quotient and Remainder in python Read More »