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)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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
Transcribed Image Text: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
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY