CSE110, PROGRAMMING
CSE110 Python Program
Question Description
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.
Example 1:
Input: 5
Output: false
Explanation: 5 is not ugly since it contains another prime factor.
Example 2:
Input: 6
Output: true
Explanation: 6 = 2 * 3
Example 3:
Please input an integer: 8
All the ugly numbers smaller than 8 is: 2, 3, 4, 6, 8.
“Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results.”