AQA A-Level Computer Science · Section 4.1 Fundamentals of Programming
| Function | Purpose | Python Equivalent |
|---|---|---|
| LEN(s) | Length of string | len(s) |
| SUBSTRING(s,i,n) | Extract n chars from index i | s[i:i+n] |
| UPPER(s) | Convert to uppercase | s.upper() |
| LOWER(s) | Convert to lowercase | s.lower() |
| ASC(c) | Character to ASCII code | ord(c) |
| CHAR(n) | ASCII code to character | chr(n) |