Skip to content

Commit 7f2e5bd

Browse files
Result Dialog variable added. The user can change the result dialog variable.
1 parent 668a32c commit 7f2e5bd

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

Basic_Maths.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,56 @@
55
"Bu Yazılımın Bir Kopyası GİTHUB da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/LinuxUsersLinuxMint"
66
"A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/LinuxUsersLinuxMint"
77

8-
def addition(x,y):
8+
def addition(x,y,ResultDialog):
99
x=x
1010
y=y
1111
global result
1212
result=x+y
13-
print("result: {0} + {1} = {2}". format(x,y,result))
14-
def Extraction(x,y):
13+
print("{3} {0} + {1} = {2}". format(x,y,result,ResultDialog))
14+
def Extraction(x,y,ResultDialog):
1515
x=x
1616
y=y
1717
global result
1818
result=x-y
19-
print("result: {0} - {1} = {2}". format(x,y,result))
20-
def Multiplication(x,y):
19+
print("{3} {0} - {1} = {2}". format(x,y,result,ResultDialog))
20+
def Multiplication(x,y,ResultDialog):
2121
x=x
2222
y=y
2323
global result
2424
result=x*y
25-
print("result: {0} * {1} = {2}". format(x,y,result))
26-
def Division(x,y):
25+
print("{3} {0} * {1} = {2}". format(x,y,result,ResultDialog))
26+
def Division(x,y,ResultDialog):
2727
x=x
2828
y=y
2929
global result
3030
result=x/y
31-
print("result: {0} / {1} = {2}". format(x,y,result))
32-
def Percentage(x,y):
31+
print("{3} {0} / {1} = {2}". format(x,y,result,ResultDialog))
32+
def Percentage(x,y,ResultDialog):
3333
x=x
3434
y=y
3535
global result
3636
result=x%y
37-
print("result: {0} % {1} = {2}". format(x,y,result))
38-
def FullDivision(x,y):
37+
print("{3} {0} % {1} = {2}". format(x,y,result,ResultDialog))
38+
def FullDivision(x,y,ResultDialog):
3939
x=x
4040
y=y
4141
global result
4242
result=x//y
43-
print("result: {0} // {1} = {2}". format(x,y,result))
44-
def TakingExponents(x,y):
43+
print("{3} {0} // {1} = {2}". format(x,y,result,ResultDialog))
44+
def TakingExponents(x,y,ResultDialog):
4545
x=x
4646
y=y
4747
global result
4848
result=x ** y
49-
print("result {0} ** {1} = {2}". format(x,y,result))
50-
def TakingRoots(x,y):
49+
print("{3} {0} ** {1} = {2}". format(x,y,result,ResultDialog))
50+
def TakingRoots(x,y,ResultDialog):
5151
x=x
5252
y=y
5353
global result
5454
result=x ** (1/y)
55-
print("result: {0} ** (1/{1}) = {2}". format(x,y,result))
55+
print("{3} {0} ** (1/{1}) = {2}". format(x,y,result,ResultDialog))
5656
def SqaureRoot(x):
5757
x=x
5858
global result
5959
result=x ** (1/2)
60-
print("result: {0} ** (1/2) = {1}". format(x,result))
60+
print("{3} {0} ** (1/2) = {1}". format(x,result,ResultDialog))

Example/basic_maths_calc.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
select=str(input('Select (Add, Ext, Mul, Div, Per, FullDiv, TakeEx): '))
88

99
if select=="Add":
10-
addition(number1,number2)
10+
addition(number1,number2,"Result:")
1111
elif select=="Ext":
12-
Extraction(number1,number2)
12+
Extraction(number1,number2,"Result:")
1313
elif select=="Mul":
14-
Multiplication(number1,number2)
14+
Multiplication(number1,number2,"Result:")
1515
elif select=="Div":
16-
Division(number1,number2)
16+
Division(number1,number2,"Result:")
1717
elif select=="Per":
18-
Percentage(number1,number2)
18+
Percentage(number1,number2,"Result:")
1919
elif select=="FullDiv":
20-
FullDivision(number1,number2)
20+
FullDivision(number1,number2,"Result:")
2121
elif select=="TakeEx":
22-
TakingExponents(number1,number2)
22+
TakingExponents(number1,number2,"Result:")
2323
else:
2424
print("Invalid Process...!")

0 commit comments

Comments
 (0)