- 2
What is the difference between input and output??
what is input and what is output?
3 Answers
+ 2
Input = ask user to input (lol) some data inside the program
Output = the program display something
0
If you have a program that can sum two numbers, you can hard-code that numbers:
a = 5
b = 3
print(a + b) # Output '8'
But, the program in this example will print always '8' (which is the output).
That's why you can make it to want input from the users. So the result of the sum (the output) can be different.
a = int(input()) # Input some number
b = int(input()) # Input another number
print(a + b) # Output the sum
0
Input data are the declared variables. Any result of your operations, or calls of functions, or anything else that uses the input data and displays them it's output.