Python Console

Writing to Console (Print statement)

Make your program talk to you! Print statements are used to print something on the console. Use print("Hello World") to print Hello World in the output screen. We will later learn that print is a function and we use it to perform a print job. Whatever you pass to the print function is printed on the screen. Let’s start by doing a print statement. A print statement allows you to take control of the computer and make it print something out! »

Reading from the Console

Now that we know the basics about variables, we can ask for input from the user. Use the following line to tell our program to wait until the user types something into the console. Then, the computer takes whatever is typed into the console, and stores it into the variable called value. value = input Here’s and examples of how to use input() to accept user input: print("What's your name?") value = input() print("Hello " + value + "! »