Why this code runs in console, but fails in the spyder editor?

Good afternoon.
Started a test algorithm differential_evolution to check the work of the library scipy.

The code runs in the console, but fails in the Spider editor or Visual Studio. Explain to the beginner what is the difference?
from scipy.optimize import rosen, differential_evolution
bounds = [(0,2), (0, 2), (0, 2), (0, 2), (0, 2)]
result = differential_evolution(rosen, bounds)
result.x, result.fun
from scipy.optimize import differential_evolution
import numpy as np
def ackley(x):
 arg1 = -0.2 * np.sqrt(0.5 * (x[0] ** 2 + x[1] ** 2))
 arg2 = 0.5 * (np.cos(2. * np.pi * x[0]) + np.cos(2. * np.pi * x[1]))
 return -20. * np.exp(arg1) - np.exp(arg2) + 20. + np.e
bounds = [(-5, 5), (-5, 5)]
result = differential_evolution(ackley, bounds)
result.x, result.fun
print(result.x, result.fun)


The result of executing writes.
in the Spider.
spoiler
runfile('C:/Users/zeo/.spyder-py3/s.py', wdir='C:/Users/zeo/.spyder-py3')

in Visual Studio, 2017
spoiler
Press any key to continue

Why?
June 14th 19 at 20:01
1 answer
June 14th 19 at 20:03
Solution
1. The toaster is a tag for code formatting. Use it to not have to guess where in your code indentation.
2. Your code runs, just has no output. In the shell, the interpreter prints the values of the variables from the last line, because it has to call the print do not have.
Thank you very much for the reply. It worked.
I wonder why no one uses Visual Studio, and all praise Pycharm?
For example, Visual Studio itself has supplied the required spaces, but in Pycharm while the gaps did not put the code does not run. - Sophie.Gleas commented on June 14th 19 at 20:06
If you originally write the code in picaro, such problems can not arise. In extreme cases, he can fix the indentation curves - https://www.jetbrains.com/help/pycharm/changing-in...
But otherwise the taste and color. Someone in the Vim sits and does not understand why you need a code editor that runs longer than 100 milliseconds. - Lola.Padberg38 commented on June 14th 19 at 20:09

Find more questions by tags Python