CSE110 Python Program

CSE110 Python Program

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.

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper