Question: 00:53 moodle.cs.colorado.edu A decent number is a positive integer that satisfies these three rules: 1) the number only consists of 3s and 5s, 2) the
00:53 moodle.cs.colorado.edu A decent number is a positive integer that satisfies these three rules: 1) the number only consists of 3s and 5s, 2) the number of 3s is divisible by 5 and 3) the number of Ss is divisible by 3 Write a Python function called common_decency that takes a positive integer argument N and returns a Boolean (True/False) representing whether or not the input integer is a decent number. For example: common_decency(2) False, because 2 is not a decent number (it fails on Rule 1, but passes on Rules 2 and 3) common_decency(555)-True, because there are only 3s and 5s passes Rule 1), the number of 3s (0) is divisible by 5 (since there exists an integer k such that 0 5k, namely 0, so it passes Rule 2), and the number of 5s (3) is divisible by 3 common_decency (53535) False, because the number of 3s is not divisible by 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
