Skip to content
MathsGenie logo
Quick links
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

Develop code

EasyMediumHard
123456789101112131415161718192021222324252627
Question 27

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]

Develop code Questions

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