Home > Article > Development Tools > How to run input function in sublime
Run the input() function in Sublime: Install the Python plug-in. Create a Python file and enter the x = input("Please enter a number:") and print("The number you entered is:", x) code. Press Ctrl B (Windows) or Cmd B (macOS) or go to the Tools menu and select Build, or right-click the file and select Build. Enter a number into Sublime Text's built-in terminal, and the program will print the number you enter.
How to run the input function in Sublime
In the Sublime text editor, you can use the following steps to runinput()
Function:
Create Python file:
Create a new Python file (.py
extension) and enter the following code:
<code class="python">x = input("请输入一个数字:") print("你输入的数字是:", x)</code>
Run the code:
Use one of the following methods to run the Python code:
Ctrl
B
(Windows) or Cmd
B
(macOS) Tools
menu and select Build
Build
For example, if you enter:
<code class="python">5</code>
the output will be:
<code>你输入的数字是: 5</code>
The above is the detailed content of How to run input function in sublime. For more information, please follow other related articles on the PHP Chinese website!