UNIT 01 · TOPIC 14
Input and Output
Use input() to read text from a user and print() to display values; convert input when you need numbers.
The idea
Input and Output, simply explained
Use input() to read text from a user and print() to display values; convert input when you need numbers.
01
See the big picture
How the idea flows
Read the diagram as a simple path: begin with a problem, use the Python idea, then verify the result.
02
Everyday connection
Real-life example
↗
A checkout asks for quantity, converts it to a number and displays the bill.
03
Learn by doing
Python code example
PYTHONExample
quantity = int(input('Quantity: '))
print('Total:', quantity * 35)Expected result
For input 3: Total: 105Try it: Change one value in the code, predict what will happen, then run it and compare your answer.
04
Keep this in mind
Key takeaways
- Use input() to read text from a user and print() to display values; convert input when you need numbers.
- Think of a real problem where input and output could save time or organize information.
- Test small changes and read the result carefully before moving to a bigger program.
Quick self-check
Can you explain it in your own words?
What is the main idea of Input and Output?
Use input() to read text from a user and print() to display values; convert input when you need numbers.
Where could you see this idea in everyday life?
A checkout asks for quantity, converts it to a number and displays the bill.
