Module 1
Combining text and values
Displaying variables alongside text.
Showing more than one thing
Sometimes you want to display text and a value together. You can pass multiple things to print, separated by commas.
PythonText and a variable together.
sample = "Control"
print("Sample:", sample)→ Sample: Control
Python adds a space between the items automatically. This is useful for making your output readable.
Your task
Combine text and a value
- Create a variable sample = "Control". Then print: Sample: Control using a comma.
Remember
print("text", variable) displays both, separated by a space.