Concept Flow - Why input and output are required
Start Program
Get Input from User
Process Input
Produce Output
End Program
The program starts by getting input, then processes it, and finally shows output before ending.
Jump into concepts and practice - no test required
name = input('Enter your name: ') print('Hello, ' + name + '!')
| Step | Action | Input/Variable State | Output |
|---|---|---|---|
| 1 | Program starts | name = undefined | |
| 2 | Input requested | Waiting for user input | |
| 3 | User enters 'Alice' | name = 'Alice' | |
| 4 | Print greeting | name = 'Alice' | Hello, Alice! |
| 5 | Program ends | name = 'Alice' |
| Variable | Start | After Input | Final |
|---|---|---|---|
| name | undefined | 'Alice' | 'Alice' |
Input lets a program get data from the user. Output shows results to the user. Without input, programs can't adapt. Without output, users can't see results. Together, they make programs interactive.
input from users?input() function to get user input.print() shows output, read() and scan() are not Python input functions.name = input('Name: ')
print('Hello, ' + name)age = input('Enter age: ')
print('You are ' + age + ' years old')age is a string here.a + b sums numbers correctly and print shows the sum.