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

Rounding and rolling

Week 12 · 1.6 Library programs · 3 lessons
Answers are for parents and teachers.
1
What does this program print? import math, then print(math.ceil(3.01)) and print(math.floor(3.99)).
Python
1import math
2print(math.ceil(3.01))
3print(math.floor(3.99))
2
A baker packs 7 rolls in each bag. She has 30 rolls. Write the line that stores the number of full bags, and the line for the number of bags needed if every roll must be packed.
3
List the possible values of random.randint(4, 8) and say how many there are.
4
A program prints 10 * random.randint(2, 5). Can it print 25? Can it print 40? Explain.
5
Explain in two sentences why a programmer should give credit when using someone’s idea.