Skip to content

Commit 35e8db7

Browse files
Important Update.
Signed-off-by: Umut <143949134+LinuxUsersLinuxMint@users.noreply.github.com>
1 parent e26f288 commit 35e8db7

File tree

4 files changed

+222
-14
lines changed

4 files changed

+222
-14
lines changed

EN/Basic_Maths.py

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#!/usr/bin/python3
2+
""" Copyright© 2023-2024 LinuxUsersLinuxMint
3+
Basic_Maths Tüm Hakları GPL(Genel Kamu Lisansı) altında korunmaktadır.
4+
Basic_Maths All Rights Reserved under the GPL(General Public License).
5+
Bu Yazılımın Bir Kopyası GİTHUB da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/Basic_Maths
6+
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/Basic_Maths"""
7+
8+
import time
9+
10+
global result,input_dialog,error_dialog
11+
12+
input_dialog = str()
13+
error_dialog = str()
14+
15+
def p(userString):
16+
print(userString)
17+
18+
def error_msg():
19+
p(error_dialog)
20+
21+
def exit_program_dialog_time(exit_dialog_msg,userTime):
22+
p(exit_dialog_msg)
23+
time.sleep(userTime)
24+
exit()
25+
26+
def exit_program_time(userTime):
27+
time.sleep(userTime)
28+
exit()
29+
30+
def exit_program_dialog(exit_dialog_msg):
31+
p(exit_dialog_msg)
32+
exit()
33+
34+
def program_welcome_msg(welcome_msg):
35+
p(welcome_msg)
36+
37+
def program_info(programnamedialog,program_name,programversiondialog,program_version,programsupportosdialog,program_support_os,programlicencedialog,program_licence,programauthordialog,program_author,programreleasedatedialog,program_rs_date):
38+
p("{0} {1}". format(programnamedialog,program_name))
39+
p("{0} {1}\n". format(programversiondialog,program_version))
40+
p("{0} {1}\n". format(programsupportosdialog,program_support_os))
41+
p("{0} {1}\n". format(programlicencedialog,program_licence))
42+
p("{0} {1}\n". format(programauthordialog,program_author))
43+
p("{0} {1}\n". format(programreleasedatedialog,program_rs_date))
44+
45+
46+
def InputN1N2():
47+
global number_one, number_two
48+
number_one = str(input("{0}". format(input_dialog)))
49+
number_two = str(input("{0}". format(input_dialog)))
50+
51+
select_func = str()
52+
"""
53+
Example:
54+
55+
input_select = str(input('Which process?'))
56+
select_func = input_select
57+
58+
def addition(x,y,ResultDialog):
59+
result=x+y
60+
print("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
61+
62+
"""
63+
64+
def addition(x,y,ResultDialog):
65+
result=x+y
66+
p("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
67+
68+
def Extraction(x,y,ResultDialog):
69+
result=x-y
70+
p("{0} {1} {2} - {3} = {4}". format(select_func,ResultDialog,x,y,result))
71+
72+
def Multiplication(x,y,ResultDialog):
73+
result=x*y
74+
p("{0} {1} {2} * {3} = {4}". format(select_func,ResultDialog,x,y,result))
75+
76+
def Division(x,y,ResultDialog,check_zero_control_msg):
77+
if x==0 or y==0:
78+
p(check_zero_control_msg)
79+
if y>0 and x>0:
80+
result=x/y
81+
p("{0} {1} {2} / {3} = {4}". format(select_func,ResultDialog,x,y,result))
82+
83+
def Percentage(x,y,ResultDialog):
84+
result=x%y
85+
p("{0} {1} {2} % {3} = {4}". format(select_func,ResultDialog,x,y,result))
86+
87+
def FullDivision(x,y,ResultDialog):
88+
result=x//y
89+
p("{0} {1} {2} // {3} = {4}". format(select_func,ResultDialog,x,y,result))
90+
91+
def TakingExponents(x,y,ResultDialog):
92+
result=x ** y
93+
p("{0} {1} {2} ** {3} = {4}". format(select_func,ResultDialog,x,y,result))
94+
95+
def TakingRoots(x,y,ResultDialog):
96+
result=x ** (1/y)
97+
p("{0} {1} {2} / (1/y) = {3}". format(select_func,ResultDialog,x,result))
98+
99+
def SqaureRoot(x,ResultDialog):
100+
result=x ** (1/2)
101+
p("{0} {1} {2} ** (1/2) = {3}". format(select_func,ResultDialog,x,result))

EN/calc.py

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

8+
from Basic_Maths import *
9+
810
cmd=str("calc> ")
11+
error_dialog = "Invalid Process!"
912

1013
print("calc> Transactions you can enter: ")
11-
print("Addition\nSubraction\n\Multiplication\nDivision\nPercentage\n 1,2,3,4")
14+
print("Addition\nSubraction\nMultiplication\nDivision\nPercentage\n1,2,3,4")
1215
n1=float(input('{0} Enter The 1st Number: '. format(cmd)))
1316
n2=float(input('{0} Enter The 2st Number: '. format(cmd)))
1417
process=input('{0} Enter the Transaction You Want to Perform: '. format(cmd))
1518
if process=="1":
16-
print("{0} + {1} = {2}". format(n1,n2,n1+n2))
19+
addition(n1,n2)
1720
elif process=="2":
18-
print("{0} - {1} = {2}". format(n1,n2,n1-n2))
21+
Extraction(n1,n2)
1922
elif process=="3":
20-
print("{0} * {1} = {2}". format(n1,n2,n1*n2))
23+
Multiplication(n1,n2)
2124
elif process=="4":
22-
print("{0} / {1} = {2}". format(n1,n2,n1/n2))
25+
Division(n1,n2,"","Number cannot be 0 when dividing!")
2326
elif process=="5":
24-
print("{0} % {1} = {2}". format(n1,n2,n1%n2))
27+
Percentage(n1,n2)
2528
else:
26-
print("Invalid Process!")
29+
error_msg()

TR/Basic_Maths.py

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#!/usr/bin/python3
2+
""" Copyright© 2023-2024 LinuxUsersLinuxMint
3+
Basic_Maths Tüm Hakları GPL(Genel Kamu Lisansı) altında korunmaktadır.
4+
Basic_Maths All Rights Reserved under the GPL(General Public License).
5+
Bu Yazılımın Bir Kopyası GİTHUB da yayınlanmaktadır Görüntülemek için: https://github.com/LinuxUsersLinuxMint/Basic_Maths
6+
A Copy of This Software is published on GITHUB To view: https://github.com/LinuxUsersLinuxMint/Basic_Maths"""
7+
8+
import time
9+
10+
global result,input_dialog,error_dialog
11+
12+
input_dialog = str()
13+
error_dialog = str()
14+
15+
def p(userString):
16+
print(userString)
17+
18+
def error_msg():
19+
p(error_dialog)
20+
21+
def exit_program_dialog_time(exit_dialog_msg,userTime):
22+
p(exit_dialog_msg)
23+
time.sleep(userTime)
24+
exit()
25+
26+
def exit_program_time(userTime):
27+
time.sleep(userTime)
28+
exit()
29+
30+
def exit_program_dialog(exit_dialog_msg):
31+
p(exit_dialog_msg)
32+
exit()
33+
34+
def program_welcome_msg(welcome_msg):
35+
p(welcome_msg)
36+
37+
def program_info(programnamedialog,program_name,programversiondialog,program_version,programsupportosdialog,program_support_os,programlicencedialog,program_licence,programauthordialog,program_author,programreleasedatedialog,program_rs_date):
38+
p("{0} {1}". format(programnamedialog,program_name))
39+
p("{0} {1}\n". format(programversiondialog,program_version))
40+
p("{0} {1}\n". format(programsupportosdialog,program_support_os))
41+
p("{0} {1}\n". format(programlicencedialog,program_licence))
42+
p("{0} {1}\n". format(programauthordialog,program_author))
43+
p("{0} {1}\n". format(programreleasedatedialog,program_rs_date))
44+
45+
46+
def InputN1N2():
47+
global number_one, number_two
48+
number_one = str(input("{0}". format(input_dialog)))
49+
number_two = str(input("{0}". format(input_dialog)))
50+
51+
select_func = str()
52+
"""
53+
Example:
54+
55+
input_select = str(input('Which process?'))
56+
select_func = input_select
57+
58+
def addition(x,y,ResultDialog):
59+
result=x+y
60+
print("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
61+
62+
"""
63+
64+
def addition(x,y,ResultDialog):
65+
result=x+y
66+
p("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
67+
68+
def Extraction(x,y,ResultDialog):
69+
result=x-y
70+
p("{0} {1} {2} - {3} = {4}". format(select_func,ResultDialog,x,y,result))
71+
72+
def Multiplication(x,y,ResultDialog):
73+
result=x*y
74+
p("{0} {1} {2} * {3} = {4}". format(select_func,ResultDialog,x,y,result))
75+
76+
def Division(x,y,ResultDialog,check_zero_control_msg):
77+
if x==0 or y==0:
78+
p(check_zero_control_msg)
79+
if y>0 and x>0:
80+
result=x/y
81+
p("{0} {1} {2} / {3} = {4}". format(select_func,ResultDialog,x,y,result))
82+
83+
def Percentage(x,y,ResultDialog):
84+
result=x%y
85+
p("{0} {1} {2} % {3} = {4}". format(select_func,ResultDialog,x,y,result))
86+
87+
def FullDivision(x,y,ResultDialog):
88+
result=x//y
89+
p("{0} {1} {2} // {3} = {4}". format(select_func,ResultDialog,x,y,result))
90+
91+
def TakingExponents(x,y,ResultDialog):
92+
result=x ** y
93+
p("{0} {1} {2} ** {3} = {4}". format(select_func,ResultDialog,x,y,result))
94+
95+
def TakingRoots(x,y,ResultDialog):
96+
result=x ** (1/y)
97+
p("{0} {1} {2} / (1/y) = {3}". format(select_func,ResultDialog,x,result))
98+
99+
def SqaureRoot(x,ResultDialog):
100+
result=x ** (1/2)
101+
p("{0} {1} {2} ** (1/2) = {3}". format(select_func,ResultDialog,x,result))

TR/calc.py

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

8+
from Basic_Maths import *
9+
810
cmd=str("calc> ")
11+
error_dialog = "Geçersiz İşlem!"
912

1013
print("calc> Girebileceğiniz işlemler: ")
11-
print("top\ncık\n\carp\nbol\nyuzde\n 1,2,3,4")
14+
print("toplama\nçıkarma\nçarpma\nbölme\nyüzde alma\n1,2,3,4,5")
1215
s1=float(input('{0} 1. sayiyi giriniz: '. format(cmd)))
1316
s2=float(input('{0} 2. sayiyi giriniz: '. format(cmd)))
1417
islem=input('{0} Gerçekleştirmek İstediğiniz İşlemi Giriniz: '. format(cmd))
1518
if islem=="1":
16-
print("{0} + {1} = {2}". format(s1,s2,s1+s2))
19+
addition(s1,s2)
1720
elif islem=="2":
18-
print("{0} - {1} = {2}". format(s1,s2,s1-s2))
21+
Extraction(s1,s2)
1922
elif islem=="3":
20-
print("{0} * {1} = {2}". format(s1,s2,s1*s2))
23+
Multiplication(s1,s2)
2124
elif islem=="4":
22-
print("{0} / {1} = {2}". format(s1,s2,s1/s2))
25+
Division(s1,s2,"","Bölme işleminde sayı 0 olamaz!")
2326
elif islem=="5":
24-
print("{0} % {1} = {2}". format(s1,s2,s1%s2))
27+
Percentage(s1,s2)
2528
else:
26-
print("Geçersiz İşlem")
29+
error_msg()

0 commit comments

Comments
 (0)