Sto usando l'editor vim come IDE per Python, di seguito è un semplice programma Python per calcolare la radice quadrata di un numero: -attesi due righe vuote PEP8 avviso in pitone
import cmath
def sqrt():
try:
num = int(input("Enter the number : "))
if num >= 0:
main(num)
else:
complex(num)
except:
print("OOPS..!!Something went wrong, try again")
sqrt()
return
def main(num):
squareRoot = num**(1/2)
print("The square Root of ", num, " is ", squareRoot)
return
def complex(num):
ans = cmath.sqrt(num)
print("The Square root if ", num, " is ", ans)
return
sqrt()
e gli avvertimenti sono: -
1-square-root.py|2 col 1 C| E302 expected 2 blank lines, found 0 [pep8]
1-square-root.py|15 col 1 C| E302 expected 2 blank lines, found 1 [pep8]
1-square-root.py|21 col 1 C| E302 expected 2 blank lines, found 0 [pep8]
Potete dire per favore perché questi avvertimenti stanno arrivando?
https://www.python.org/dev/peps/pep-0008/#blank-lines – Jasper