From the course: Certified Entry-Level Python Programmer (PCEP-30-02) Cert Prep

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Receiving input data from the console

Receiving input data from the console

- [Max] So at this point, we know how to output messages to the console. Let's understand how to get data from the console. And in this case, we are going to receive data from the user, and that's a function that we have already seen quickly. It's input. So when you call input, it's a function. So we use parenthesis, and we execute this. The console is actually waiting for us to type something. So you can see I'm typing in the console, and that typing ends when you send a new line character, that is typically the Enter or Return key in your keyboard, and now the program is ending. So actually what will happen is that Python will wait here in this line to that input. So if I print Thanks and I execute this, you can see in the console, I'm not seeing Thanks. I need to type something, press Enter or Return to actually see the Thanks output. So Python will wait every time there is an input call until the user is typing…

Contents