Question: Please write a code for Python 3 considering code efficiency 1. Write code for a function that takes in a number and checks whether a

Please write a code for Python 3 considering code efficiency

1. Write code for a function that takes in a number and checks whether a number is a multiple of 3. If it is, return a true value otherwise return a false value.

2. Write code for function main, which gets the user to enter an integer. Use function of the previous question to check if the entry is a multiple of 3. If it is, use a for loop to create a list where the for loop runs for a number of times equal to the entry. Each time, ask the user for a number, and if the number is a multiple of 3, then add it to the end of the list. If the number is not a multiple of 3, then add 0 to the list. Call main at the end.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!