7 / 2 is 3.5. Use floor(7 / 2) to round down to 3, or round(x) for the nearest whole number.
7 % 2 gives the remainder, 1. It's handy for checking even numbers: n % 2 == 0.
Open it in the editor and run it, then change it and see what happens.
sweets = 7"Each friend gets " + floor(sweets / 2)"Left over: " + sweets % 2Each friend gets 3Left over: 1import math
def remainder_of(a, b): # Like % in B4Coder: the remainder has the sign of a, so -7 % 3 is -1 (Python's % gives 2). r = abs(a) % abs(b) return -r if a < 0 else r
sweets = 7print("Each friend gets " + str(math.floor(sweets / 2)))print("Left over: " + str(remainder_of(sweets, 2)))