Skip to content

Instantly share code, notes, and snippets.

View dnsouzadev's full-sized avatar
💫
Focusing

daniel souza dnsouzadev

💫
Focusing
View GitHub Profile
@dnsouzadev
dnsouzadev / equacao-segundo-grau.py
Created March 15, 2022 16:43
Calcular equação de segundo grau em Python
from math import sqrt
def delta(a: int, b: int, c: int):
res = (b ** 2) - 4 * a * c
return res
def function(a: int, b: int, raiz_delta: int):
x1 = (-b + raiz_delta) / (2 * a)
@dnsouzadev
dnsouzadev / formula-heron.py
Created March 15, 2022 16:45
Script pra calcular a formula Heron
from math import sqrt
def calcula_area(a, b, c):
try:
s = 0.5 * (a + b + c)
res = sqrt(s * (s - a) * (s - b) * (s - c))
res = round(res, 2)
return f"A área desse triângulo é {res} metros quadrados"
except ValueError:
{"name":"meu","settings":"{\"settings\":\"{\\r\\n \\\"editor.fontSize\\\": 14,\\r\\n \\\"python.testing.autoTestDiscoverOnSaveEnabled\\\": true,\\r\\n \\\"python.languageServer\\\": \\\"Pylance\\\", // ms-python.vscode-pylance\\r\\n \\\"python.testing.unittestEnabled\\\": false, // ms-python.python\\r\\n \\\"python.testing.pytestEnabled\\\": true,\\r\\n \\\"python.testing.pytestArgs\\\": [], // -x to bail\\r\\n \\\"python.linting.flake8Enabled\\\": true,\\r\\n \\\"python.linting.mypyEnabled\\\": true,\\r\\n \\\"python.analysis.autoImportCompletions\\\": true,\\r\\n \\\"python.linting.pylintArgs\\\": [\\r\\n \\\"--load-plugins=pylint_django\\\",\\r\\n \\\"--errors-only\\\"\\r\\n ],\\r\\n \\\"python.formatting.autopep8Args\\\": [\\r\\n \\\"--indent-size=4\\\"\\r\\n ],\\r\\n \\\"[python]\\\": {\\r\\n \\\"editor.defaultFormatter\\\": \\\"ms-python.python\\\", // ms-python.python\\r\\n \\\"editor.tabSize\\\": 4,\\r\\n \\\"editor.insertSpaces\\\": true,\\r\\n \\\"editor.formatOnSa