Chrome Capture 767x397 Create a python program called code.py. Write a function named pi_multiples() that takes an integer parameter num. This function repeatedly asks the user to enter an integer...


Chrome Capture 767x397<br>Create a python program called code.py.<br>Write a function named pi_multiples() that takes an integer parameter num. This<br>function repeatedly asks the user to enter an integer between 2 and 50. Assume the<br>user will always enter an integer, but if the number is outside this range, the loop<br>must end. So, for any integer x entered within the range, your function must do the<br>following; if x is divisible by num (the parameter), it must multiply x by the value of pi<br>(call it result) and maintain a sum of these results. In every iteration of the loop your<br>function must print x and the result. And when the loop terminates your function<br>should return the sum.<br>To test your function, call pi_multiples() function using any integer number of your<br>choice (for num) and print the returned value.<br>Hint: to use the pi value do the following<br>import math and use math.pi for the value of pi.<br>frames: 0<br>0/ 10 secs<br>Zip your file, name it code.zip, and submit it using the link available in this question.<br>

Extracted text: Chrome Capture 767x397 Create a python program called code.py. Write a function named pi_multiples() that takes an integer parameter num. This function repeatedly asks the user to enter an integer between 2 and 50. Assume the user will always enter an integer, but if the number is outside this range, the loop must end. So, for any integer x entered within the range, your function must do the following; if x is divisible by num (the parameter), it must multiply x by the value of pi (call it result) and maintain a sum of these results. In every iteration of the loop your function must print x and the result. And when the loop terminates your function should return the sum. To test your function, call pi_multiples() function using any integer number of your choice (for num) and print the returned value. Hint: to use the pi value do the following import math and use math.pi for the value of pi. frames: 0 0/ 10 secs Zip your file, name it code.zip, and submit it using the link available in this question.

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here