Skip to content

Commit 357db29

Browse files
committed
0.4.0 C8
1 parent 320c2ca commit 357db29

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

Simpl-Py.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import wmi
33
version, updated = '0.4.0', '4/21/2022'
44
varName, varVal = [], []
5-
cMathInts, cMathSub = [], 0
5+
cMathInts, cMathSub, cMathMult, cMathDiv = [], 0, 0, 0
66

77
# Functions
88
def systemInfoDisp():
@@ -42,6 +42,7 @@ def printHandler(code):
4242
cEchoOut = cEcho * cEchoAmount
4343
return cEchoOut
4444
elif code == 'print_math':
45+
cMathInts.clear()
4546
cMathIntCount = int(input('Number of Integers: '))
4647
for i in range(0, cMathIntCount):
4748
cMathInts.append(int(input('Integer: ')))
@@ -53,18 +54,19 @@ def printHandler(code):
5354
for i in range(1, len(cMathInts)):
5455
cMathSub -= cMathInts[i]
5556
return cMathSub
56-
5757
elif cMathOp == '*':
58-
print('{} * {} = '.format(cMathInt1, cMathInt2))
59-
return (cMathInt1 * cMathInt2)
58+
cMathMult = cMathInts[0]
59+
for i in range(1, len(cMathInts)):
60+
cMathMult *= cMathInts[i]
61+
return cMathMult
6062
elif cMathOp == '/':
61-
print('{} / {} = '.format(cMathInt1, cMathInt2))
62-
return (cMathInt1 / cMathInt2)
63+
cMathDiv = cMathInts[0]
64+
for i in range(1, len(cMathInts)):
65+
cMathDiv /= cMathInts[i]
66+
return cMathDiv
6367
else:
6468
return 'Invalid operator.'
6569

66-
cMathInts.clear()
67-
6870
elif code == 'print.correct':
6971
cCorrect = input('Correct What? ')
7072
return cCorrect.capitalize()

0 commit comments

Comments
 (0)