3. Input and Output
Python |
Pseudocode |
|---|---|
OUTPUT or PRINT or DISPLAY |
|
input |
INPUT or GET |
3.1. Input
In python, input returns strings.
name = input("Enter your name:")
Pseudocode. The equivalent pseudocode is:
INPUT "Enter your name:"
3.2. Output
Print statements in Python are forms of output.
print("Winner")
Pseudocode. The equivalent pseudocode is:
PRINT "Winner"
Note
Some pseudocode variants use the python style: PRINT “Winner”
Tasks
Write pseudocode for the python statement:
input("Enter your age in years:").Write pseudocode for the python statement:
print("Melbourne").
Write pseudocode for the python statement: input("Enter your age in years:").
INPUT "Enter your age in years:"
Write pseudocode for the python statement: print("Melbourne").
PRINT "Melbourne"
Tasks
Write python for this pseudocode:
INPUT "Enter your first name:".Write python for this pseudocode:
PRINT "Top score".
Write python for this pseudocode: INPUT "Enter your first name:".
input("Enter your first name:")
Write python for this pseudocode: PRINT "Top score".
print("Top score")