How do I use raw_input in Python 3?
In Python 3, the input()
function can be used in place of raw_input()
to read input from the user. Here's an example of how to use the input()
function to read a string from the user:
Watch a video course
Python - The Practical Guide
In this example, the input()
function will display the string "What is your name? " and wait for the user to input a string, which will be stored in the variable name
. The program will then print out "Hello, [name]!" using the value stored in the name
variable.