Output
A string is text written inside quotation marks, such as 'Ready to launch'. It can hold letters, digits, spaces and punctuation, and everything between the marks is part of the string, so the space in 'Ready to launch' is stored exactly as you typed it.
The quotation marks are delimiters: they show the computer where the string starts and where it ends. They are not part of the text itself, so they are never printed. Only the characters inside them reach the screen.
# the quotation marks mark out the text but are not shown
print("Gallery opens at 10am")
print('Exhibition: Sculpture')Output:
Gallery opens at 10am
Exhibition: Sculpture
You can wrap a string in either single or double quotation marks. print('Match postponed') and print("Match postponed") do exactly the same thing, so pick one style and keep to it.
What matters is that the two ends match: the string must open and close with the same type of mark. If you start with a double mark and finish with a single one, the computer looks for a closing " and never finds it, so the program stops with an error before anything is printed.
OCR GCSE Computer Science · Output