-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.py
86 lines (67 loc) · 1.63 KB
/
scripts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
def multiplicacion(x, y):
try:
a = float(x)
b = float(y)
resultado = a*b
return resultado
except ValueError:
return "null"
def division(x, y):
try:
a = float(x)
b = float(y)
resultado = a/b
return resultado
except ValueError:
return "null"
def resistencia_equivalente_serie(x, y, z):
try:
a = float(x)
b = float(y)
c = float(z)
if a and b and c > 0:
resultado = a + b + c
return resultado
else:
return "null"
except ValueError:
return "null"
def resistencia_equivalente_paralelo(x, y, z):
try:
a = float(x)
b = float(y)
c = float(z)
if a and b and c > 0:
resultado = 1/((1/a)+(1/b)+(1/c))
return resultado
else:
return "null"
except ValueError:
return "null"
def resistencia_equivalente_paralelo_jre(x, y):
try:
a = float(x)
b = float(y)
if a > 0 and b > 0:
resultado = 1/((1/a)+(1/b))
return resultado
else:
return "null"
except ValueError:
return "null"
def corriente_total(x, y):
try:
a = float(x)
b = float(y)
resultado = a/b
return resultado
except ValueError:
return "null"
def potencia_total(x, y):
try:
a = float(x)
b = float(y)
resultado = a*b
return resultado
except ValueError:
return "null"