n this problem, you have available to you a working version of the function round_up described in part (a). It is located in a module named foo. Using the given round_up function, write a function round_up_all that takes a list of integers and MODIFIES the list so that each number is replaced by the result of calling round_up_ on that number. For example, if you run the code, 1st = [43, 137, 99, 501, 300, 275] round_up_all(1st) print(1st) the list would contain the values [100, 200, 100, 600, 300, 300] Do not re-implement the round_up function, just import the food module and use it. Here is the code for the round_up function that can be imported using foo: def round_up(num): if num % 100 == 0 : #if number is complete divisible return num #return orginal num else: return num + (100-(num % 100)) #else add 100-remainder to num, if __name__ == '__main__': print(round_up(234)) print(round_up(465)) print(round_up(400)) print(round_up(89)
In this problem, you have available to you a working version of the function round_up described in part (a). It is located in a module named foo. Using the given round_up function, write a function round_up_all that takes a list of integers and MODIFIES the list so that each number is replaced by the result of calling round_up_ on that number. For example, if you run the code,
1st = [43, 137, 99, 501, 300, 275]
round_up_all(1st)
print(1st)
the list would contain the values [100, 200, 100, 600, 300, 300]
Do not re-implement the round_up function, just import the food module and use it.
Here is the code for the round_up function that can be imported using foo:
def round_up(num):
if num % 100 == 0 : #if number is complete divisible
return num #return orginal num
else:
return num + (100-(num % 100)) #else add 100-remainder to num,
if __name__ == '__main__':
print(round_up(234))
print(round_up(465))
print(round_up(400))
print(round_up(89))
![A
poks My library > COMS 127: Introduction to Programming for Problem Solving home > 38.4: Problem F3b
E zyBooks catalog
Help/FAQ
This lab will be available until May 31st, 11:59 PM CDT
You can get full credit on this part even if you did not complete part (a).
In this problem, you have available to you a working version of the function round_up described in part (a). It is located in a module named
foo.
Using the given round_up function, write a function round_up_all that takes a list of integers and MODIFIES the list so that each
number is replaced by the result of calling round_up on that number. For example, if you run the code,
1st
[42, 137, 99, 501, 300, 275]
round_up_all (lst)
print(lst)
the list would contain the values [100, 200, 100, 600, 300, 300]
Do not re-implement the round_up function, just import the foo modulę and use it.
switching to "Submit Mode
clicking ubmit
ubmission will be graded. Clicking Submit will als
read your code to check that it makes sense and actually solves the problem.
376584.2127280.qx3zgy7
LAB
38.4.1: Problem F3b
ACTIVITY
0/15
main.py
Load default template...
1 import foo
3 # Write your round_up_all function here. DO NOT WRITE round_up AGAIN, USE THE ONE
4 # ALREADY IMPLEMENTED IN THE foo MODULE IMPORTED ABOVE](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F35a6a7ab-6f7e-4dff-9510-82f9c5d6fb4f%2Fe22571af-9198-441f-a49c-4fa8dee83378%2F8chyf7l_processed.jpeg&w=3840&q=75)

Step by step
Solved in 2 steps with 1 images









