banner



Which Is The Rate Of Change For The Interval Between 3 And 6 On The X-axis? –3 –2 2 3

Python program to print all the numbers divisible by iii and v for a given number


This is a python program to impress all the numbers which are divisible by 3 and 5 from a given interger Northward. There are numerous ways we can write this program except that we demand to check if the number is fully divisble by both 3 and five.

Below is my code to write a python programme to print all the numbers divisible past 3 and 5 −

lower = int(input("Enter lower range limit:")) upper = int(input("Enter upper range limit:")) for i in range(lower, upper+1):    if((i%three==0) & (i%v==0)):       print(i)

Output

Enter lower range limit:0 Enter upper range limit:99 0 fifteen 30 45 lx 75 90

Above we try to print all the numbers between 0 and 99 which are divisble by 3 and v. Same program can be used to print all the number between 0 and one thousand which are divisible by 3 and 5, nosotros but need to alter our range and our output will be something like,

Enter lower range limit:0 Enter upper range limit:thou 0 15 30 45 60 75 xc 105 120 135 150 165 180 195 .... .... 915 930 945 960 975 990

In case we want to write a program which will print all the numbers in a range divisible by a given number non the fixed number like in a higher place, i just demand to update by program like,

#Incase we want to print all number betwixt a range divided past any given number n = int(input("Enter the number to be divided by:")) for i in range(lower, upper+one):    if(i%n==0):       print(i)

Beneath the steps to write to a higher place code −

  • Take the lower and upper limit .i.e. the range from the user.

  • Accept the number to exist divided by from the user. In case of our main problem, because we know that numbers(3 and 5), i write the 3 and 5 in the if argument simply.

  • Using a loop with &(and) operator statement(so that it print only those numbers which are divisble by both 3 & 5), prints all the factors which is divisible by the number.

  • Go out.

raja

Published on xix-Feb-2019 11:55:42

  • Related Questions & Answers
  • C# plan to print all the numbers divisible by 3 and 5 for a given number
  • Program to print all the numbers divisible by 3 and 5 in C++
  • Python Program to Impress all Numbers in a Range Divisible past a Given Number
  • Golang Program to Print all Numbers in a Range Divisible by a Given Number
  • Golang Program to Find the Numbers which are Divisible by 7 and Multiple of 5 in a Given Range
  • Largest number with the given set of Northward digits that is divisible by ii, three and 5 in C++
  • Python Programme for Efficient program to impress all prime factors of a given number
  • Check if a large number is divisible past 2, 3 and 5 or not in C++
  • Python Plan to Print all Integers that are not Divisible by Either ii or three and Lie between 1 and 50
  • Split up number into two parts divisible by given numbers in C++ Programme
  • Binary Prefix Divisible By v in Python
  • Count due north digit numbers divisible past given number in C++
  • Golang Plan to print all integers betwixt a range that aren't divisible by either two or three
  • Python Program for Smallest Thousand digit number divisible by X
  • C Program for efficiently impress all prime number factors of a given number?

Source: https://www.tutorialspoint.com/python-program-to-print-all-the-numbers-divisible-by-3-and-5-for-a-given-number

Posted by: xiongbefornes.blogspot.com

0 Response to "Which Is The Rate Of Change For The Interval Between 3 And 6 On The X-axis? –3 –2 2 3"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel