Python Guide | Using Keyboard Input Function. (input & raw_input).
Python Keyboard Input. Here is a basic python tutorial, we will learn how to use input keyboard function on this program. Almost every program certainly use the keyboard input commands. In fact there are a various of ways to sent an input. For example input from keyboard, from mouse click, input from database, input from another computer. For this case, we will show you how to use input function, we can input string data or integer data.
There are two kinds of input commands you need to know,
- First, raw_input
- This command reads a line from input, then returns a string by stripping a trailing newline.
- Second, input
- Used to get expression from the keyboard input, for example mathematics expression (3*3, 9+2, 5/2, ...etc)
So, if you still confuse with my explanations. Now follow the tutorial guide below.
Only Integer data type can be entered here.