...

Web Technologies - PYTHON

Back to Course

Lesson Description


Lession - #290 Python User Input



User Input

Python accepts user input.

That means we can solicit input from the user.

In Python 3.6, the procedure is slightly different than in Python 2.7.

The input(>
function is used in Python 3.6.

The raw input(>
function is used in Python 2.7.

The username is requested in the following example, and after entered, it is printed on the screen:

Python 3.6
Sorry cannot be displayed Output:

C:\Users\My Name>python demo_user_input3.py
Enter username:
Kamala

Username is: Kamala
Try it here



Python 2.7
Sorry cannot be displayed

Output:

C:\Users\My Name>python demo_user_input2.py
Enter username:
Rajesh

Username is: Rajesh
Try it here