301.1 Output and Sequence
Practise exam questionsOutput and Sequence — Note 1 of 3
Use print statements to display text or data.
The print() function is the most fundamental way to produce output in Python. It sends text, numbers, or the value of variables to the console so the user can see results. Every program that communicates with a user will use output.
print() outputs text to the consoleprint() adds a newline at the end by defaultprint("Hello, world!")
# Output: Hello, world!name = "Alice"
age = 15
print("Name:", name, "Age:", age)
# Output: Name: Alice Age: 15Specification notes for programming are in Paper 2.