Skip to content

Course home

Develop code

Develop code

EasyMediumHard
1234567891011121314151617181920212223242526
Question 6

A programmer has written a Python program to calculate how many full 6-pack egg boxes can be filled from a collection of 57 eggs, and how many individual eggs will be left over.

There are three errors in the code.

total_eggs = 57
box_size = 6

# Calculate how many full boxes can be filled
full_boxes = total_eggs / box_size

# Calculate leftover eggs
left_over = total_eggs // box_size

# Output the results
print("Full boxes: " + str(full_boxes))
print("Leftover eggs: " + str(leftover))

Amend the code to correct the three errors.

[3]
Markscheme

Develop code Questions

  1. IGCSE
  2. /Computer Science
  3. /Develop code

62 exam-style questions on Edexcel IGCSE Computer Science Develop code. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank