Skip to content

Course home

Develop code

Develop code

EasyMediumHard
1234567891011121314151617181920212223242526
Question 26

Elena runs a local plant nursery. She wants a program that will generate unique identification batch codes for the plants she propagates.

The program must:

  • Prompt the user to enter the name of a plant.
  • Generate a five-character batch code that:
    • starts with the first three letters of the plant name.
    • ends with a random integer between 40 and 80 (inclusive).
  • Display the plant name followed by the generated batch code.

Template

You must use the following code skeleton to complete the program:

import random

# 1. Input the plant name
plant_name =

# 2. Generate the batch code

# 3. Output the plant name followed by the batch code

Write the completed program.

[7]
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