Python – Console Line Input / Output

Console Line Input and Output is an imperative fundamentals for writing in any programming language. It may be used as input and output for human readable text or numbers or for troubleshooting aspects of your code as you develop your application.

The print() function is the most basic way to output characters.

For example, if I add the statement: print(“Hello World”)

I get the output: Hello World

Additionally, I can also print the output of variables which we’ll see later on.
The input() function is used for standard input. The function reads the

For example if I add the statement: newInput = input(“New Input: “)

And I input “Hi…this is new text” when prompted after I run the script.

I get the output: New Input: Hi…this is new text

Putting it all together….

Sample Code:

import sys

newInput = input(“New Input: “)

print(newInput)

**This article is written for Python 3.6

<< Import Modules

Data Structures >>

%d bloggers like this: