An automated weather monitoring network generates data telemetry packets with a specific code format.
The format of each telemetry packet code is structured as follows:
:).:).:).Example valid telemetry packet codes:
UK:STN03:TEMP:08194US:STN21:WIND:11048FR:STN09:HUMI:00392Assume a variable named packet_id stores one of these valid codes as a string.
Construct an expression, using string slicing or indexing, to extract the 4-character sensor type code from packet_id.
44 exam-style questions on Edexcel GCSE Computer Science Data types and structures, covering Primitive and structured data types, Using variables and constants, and Manipulating strings. Each one has a worked solution and a mark scheme showing where the marks go.