If a positive number whose prime factors only contain 2,3,5, we call it an ugly number.
You need to write a python program to realize such function:
(1) ask for a positive integer as input, give the judgment if this number is an ugly number. Give an explanation of why it is (or not) an ugly number.
(2) ask for a positive, then display all the ugly numbers smaller than this one.
Explanation: 5 is not ugly since it contains another prime factor.
Explanation: 6 = 2 * 3
Please input an integer: 8
All the ugly numbers smaller than 8 is: 2, 3, 4, 6, 8.
NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.
The post you need to write a python program to realize such function appeared first on The Nursing Hub.