AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Ready-made helpers

Week 10 · 1.6 Library programs · 3 lessons
Answers are for parents and teachers.
1
Write a function twelve() that returns 12 and a line that prints twelve() + 5. What is printed?
2
What does this program print? Replace each call with its returned value as you trace it.
Python
1def plus_ten(n):
2    return n + 10
3
4print(plus_ten(3) + plus_ten(2))
3
Say whether each is a procedure or a function: (a) a sub-routine that prints a menu; (b) a sub-routine that returns the price with delivery added.
4
Give one benefit and one risk of using a library, and one thing you would do about the risk.
5
Explain why a sub-routine helps when two programmers work together on one big program.