Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python 3 Programming exercises: Question 3a Open a new file with IDLE. Write a program that has a function called is_divisible The function is divisible

Python 3

image text in transcribed

image text in transcribed

Programming exercises: Question 3a Open a new file with IDLE. Write a program that has a function called is_divisible The function is divisible has two input parameters that are integers n and m and returns True if n is divisible by m and False otherwise. Outside of that function, your program should interact with the user to get two integers. To determine if the 1st is divisible by the 2nd it should call is divisible function. It should print a message explaining the result. Two example tests (one on the left and one on the right) >>> Enter 1st integer: Enter 1st integer: Enter 2nd integer: Enter 2nd integer: 9 is divisble by 3 8 is not divisble by 3 18 Programming exercises: Question 3b Open a new file with IDLE. Write a program that has two functions one called is divisible and the other called is divisible23n8 The function is divisible is the same as in the previous questions so you can copy/paste it to the beginning of the new file. The function is divisible23n8 has one input parameter, an integer. It should return string "yes" if the given number is divisible by 2 or 3 but not 8. Otherwise it should return a string "no". Your function is divisible23n8 must use, i.e make a call to, is divisible Outside of that function, your program should interact with the user to get one integer. It should call is divisible23n8 function to deterimen if the number the user gave is divisible by 2 or 3 but not 8. It should print a message explaining the result. Enter an integer: 18 18 is divisible by 2 or 3 but not 8 Enter an integer: 16 It is not true that 16 is divisible by 2 or 3 but not 8 Enter an integer: 3 3 is divisible by 2 or 3 but not 8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions