How to call idle in python?
First we click on our start menu, click 'IDLE (Python 3.6 64-bit)' in the python directory installed in the start menu, and enter IDLE, as shown below:
The interface in the picture below is the interface of IDLE. We can change python in this interface. In the window of the picture below, you can see that '>>>'IDLE is ready Okay, let's write python just after '>>>', as shown below:
Here we use a print function in IDLE to do a simple To test, we directly enter "print("i love fise")" and press Enter. We can see that our first python program has been written successfully. The compiler faithfully prints out the content we want python to print, as shown below:
Next we use the print function again, directly enter 'print "i love fish"', and then press Enter, you can see that the compiler did not print what we wanted Instead, an error is reported. Here I will explain that the functions used in step 3 and step 4 are the same, but step 3 uses the syntax of python3, and step 4 uses the syntax of python2. Here, the editor The installation is python3, so the compiler does not recognize the syntax format of python2, as shown below:
Here the editor directly enters 'print(3 5)', we can see Python directly outputs the calculation result 8, as shown below:
Here the editor directly inputs '3 5', and you can see that python can also directly output the calculation result 8, as shown below :
Here the editor directly inputs 'print("i love fish"*8)', and you can see that python outputs 8 'i love fish', as shown below :
From the above series of tests, we have been able to simply use IDLE and learned some knowledge about the print function.
The above is the detailed content of How to call idle in python. For more information, please follow other related articles on the PHP Chinese website!