skip to content
Sergio's Blog CS

Inputs and Outputs in Python, Java and Pseudocode

/ 4 min read

In this one, multiple differences in the main structures will be specified for educational purposes. Each structure will present JAVA, PYTHON and PSEUDOCODE syntax that allows to determine the essential differences. Remember that the most important element in coding has to do with learning the concepts rather than the structure since it’s widely applied to all main programming languages.

Python offers a simple syntax where a variable can store a value directly from an input and the declaration of the variable can happen in the same line where it’s assigned a value. To achieve so, you need to use the command input. This function receives by default a string type. Hence, that’s why there is no need to add str before it. For the other data types, it’s mandatory to use the corresponding function to convert them.

Use int for converting strings to integers and float to convert them to real numbers.

In case of creating an OUTPUT, use the function print() to show it to the console.

Python
var_name = input("This reads an string from the user.")
num_name = int(input("This reads an integer."))
real_name = float(input("This reads a real number."))
#Built for output messages
print("This is a test that outputs the values of the variables", var_name, num_name, real_name )