Skip to content

Commit b7a09e1

Browse files
Update Basic_Maths.
1 parent 2852fbd commit b7a09e1

File tree

2 files changed

+14
-51
lines changed

2 files changed

+14
-51
lines changed

Basic_Maths/Basic_Maths.py

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,83 +7,45 @@
77

88
from Basic_Maths.Lib.lib import *
99

10-
""" TR (Turkish / Türkçe):
11-
NOT: InputN1N2() sadece 2 sayının istendiği durumlarda kullanılabilir.
12-
13-
EN (English / İngilizce):
14-
NOTE: InputN1N2() can be used when only 2 numbers are required. """
15-
16-
def InputN1N2(number_one_dialog,number_two_dialog):
17-
global number_one, number_two
18-
number_one = float(input("{0}". format(number_one_dialog)))
19-
number_two = float(input("{0}". format(number_two_dialog)))
20-
21-
select_func = str()
22-
"""
23-
Example:
24-
25-
input_select = str(input('Which process?'))
26-
select_func = input_select
27-
28-
def Addition(x,y,ResultDialog):
29-
result=x+y
30-
print("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
31-
32-
"""
33-
3410
def Addition(x,y,ResultDialog):
35-
result=x+y
36-
print("{0} {1} {2} + {3} = {4}". format(select_func,ResultDialog,x,y,result))
11+
print("{0} {1} + {2} = {3}". format(ResultDialog,x,y,x+y))
3712

3813
def Extraction(x,y,ResultDialog):
39-
result=x-y
40-
print("{0} {1} {2} - {3} = {4}". format(select_func,ResultDialog,x,y,result))
14+
print("{0} {1} - {2} = {3}". format(ResultDialog,x,y,x-y))
4115

4216
def Multiplication(x,y,ResultDialog):
43-
result=x*y
44-
print("{0} {1} {2} * {3} = {4}". format(select_func,ResultDialog,x,y,result))
17+
print("{0} {1} * {2} = {3}". format(ResultDialog,x,y,x*y))
4518

4619
def Division(x,y,ResultDialog,check_zero_control_msg):
4720
if x==0 or y==0:
4821
print(check_zero_control_msg)
4922
if y>0 and x>0:
50-
result=x/y
51-
print("{0} {1} {2} / {3} = {4}". format(select_func,ResultDialog,x,y,result))
23+
print("{0} {1} / {2} = {3}". format(ResultDialog,x,y,x/y))
5224

5325
def Percentage(x,y,ResultDialog):
54-
result = (x*y)/100
55-
print("{0} {1} ({2} * {3})/100 = {4}". format(select_func,ResultDialog,x,y,result))
26+
print("{0} ({1} * {2})/100 = {3}". format(ResultDialog,x,y,(x*y)/100))
5627

5728
def Mod(x,y,ResultDialog):
58-
result=x%y
59-
print("{0} {1} {2} % {3} = {4}". format(select_func,ResultDialog,x,y,result))
29+
print("{0} {1} % {2} = {3}". format(ResultDialog,x,y,x%y))
6030

6131
def FullDivision(x,y,ResultDialog):
62-
result=x//y
63-
print("{0} {1} {2} // {3} = {4}". format(select_func,ResultDialog,x,y,result))
32+
print("{0} {1} // {2} = {3}". format(ResultDialog,x,y,x//y))
6433

6534
def TakingExponents(x,y,ResultDialog):
66-
result=x ** y
67-
print("{0} {1} {2} ** {3} = {4}". format(select_func,ResultDialog,x,y,result))
35+
print("{0} {1} ** {2} = {3}". format(ResultDialog,x,y,x**y))
6836

6937
def TakingRoots(x,y,ResultDialog):
70-
result=x ** (1/y)
71-
print("{0} {1} {2} / (1/{3}) = {4}". format(select_func,ResultDialog,x,y,result))
38+
print("{0} {1} / (1/{2}) = {3}". format(ResultDialog,x,y,x**(1/y)))
7239

7340
def SqaureRoot(x,ResultDialog):
74-
result=x ** (1/2)
75-
print("{0} {1} {2} ** (1/2) = {3}". format(select_func,ResultDialog,x,result))
41+
print("{0} {1} ** (1/2) = {2}". format(ResultDialog,x,x**(1/2)))
7642

7743
""" TR (Turkish / Türkçe):
7844
NOT: "Basic_Maths" kütüphanesini kullanan geliştiriciler programlarındaki ihtiyaçlara göre "Basic_Maths" fonksiyonlarını değiştirebilirler.
79-
NOT2: "select_process" değişkeni ile geliştiriciler isteğe bağlı olarak programlarında kullanıcılar tarafından seçilen işlemi gösterebilir.
80-
NOT3: "nod" ve "ntd" değişkenleri ile beraber geliştiriciler "all_math_operations()" fonksiyonunda "InputN1N2()" fonksiyonunu kullanabilir ve bu değişkenler aracılığıyla 1. sayı ve 2. sayı diyaloglarını ekleyebilirler.
8145
ÖNERİ: Eğer istekleriniz veya ihtiyaçlarınız farklıysa "all_math_operations()" fonksiyonunu kullanmadan önce ihtiyaçlarınız doğrultusunda değiştirmeniz önerilir.
8246
8347
EN (English / İngilizce):
8448
NOTE: Developers using the "Basic_Maths" library can change the "Basic_Maths" functions according to the needs of their programs.
85-
NOTE2: With the "select_process" variable, developers can optionally display the process selected by users in their programs.
86-
NOTE3: Along with the "nod" and "ntd" variables, developers can use the "InputN1N2()" function in the "all_math_operations()" function and add the 1st issue and 2nd issue dialogs through these variables.
8749
SUGGESTION: If your wishes or needs are different, it is recommended that you change it according to your needs before using the "all_math_operations()" function. """
8850

8951
def all_math_operations(optDialog,first_opt_dialog,second_opt_dialog,third_opt_dialog,fourth_opt_dialog,fifth_opt_dialog,sixth_opt_dialog,seventh_opt_dialog,eighth_opt_dialog,ninth_opt_dialog,tenth_opt_dialog,SelectOptDialog,nod,ntd,resdialog,divisionzerocheckdialog,errdg,addition_options_one,addition_options_two,addition_options_three,addition_options_four,addition_options_five,extraction_options_one,extraction_options_two,extraction_options_three,extraction_options_four,extraction_options_five,multiplication_options_one,multiplication_options_two,multiplication_options_three,multiplication_options_four,multiplication_options_five,division_options_one,division_options_two,division_options_three,division_options_four,division_options_five,percentage_options_one,percentage_options_two,percentage_options_three,percentage_options_four,percentage_options_five,fulldivision_options_one,fulldivision_options_two,fulldivision_options_three,fulldivision_options_four,fulldivision_options_five,takingexponents_options_one,takingexponents_options_two,takingexponents_options_three,takingexponents_options_four,takingexponents_options_five,takingroots_options_one,takingroots_options_two,takingroots_options_three,takingroots_options_four,takingroots_options_five,squareroot_options_one,squareroot_options_two,squareroot_options_three,squareroot_options_four,squareroot_options_five,mod_options_one,mod_options_two,mod_options_three,mod_options_four,mod_options_five):
@@ -99,7 +61,8 @@ def all_math_operations(optDialog,first_opt_dialog,second_opt_dialog,third_opt_d
9961
print(ninth_opt_dialog)
10062
print(tenth_opt_dialog)
10163
select_func = str(input(SelectOptDialog))
102-
InputN1N2(nod,ntd)
64+
number_one=input(nod)
65+
number_two=input(ntd)
10366
if select_func == addition_options_one or select_func == addition_options_two or select_func == addition_options_three or select_func == addition_options_four or select_func == addition_options_five:
10467
Addition(number_one,number_two,resdialog)
10568
elif select_func == extraction_options_one or select_func == extraction_options_two or select_func == extraction_options_three or select_func == extraction_options_four or select_func == extraction_options_five:

Basic_Maths/lib_ver_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
PYTHON_LIB_LICENCE="GPL2"
1010
PYTHON_LIB_IMPLEMENTED_CONTRACTS="LinuxUsersLinuxMint Privacy and Security Agreement , LinuxUsersLinuxMint Web (Site) Agreement"
1111
PYTHON_LIB_IMPLEMENTED_CONTRACTS_WEB_SITE="https://linuxuserslinuxmint.github.io/Contracts/privacyandsecutryagreement/en/privacyandsecutryagreement.html , https://linuxuserslinuxmint.github.io/Contracts/linuxuserslinuxmintwebsiteagreement/en/linuxuserslinuxmintwebsiteagreement.html"
12-
PYTHON_LIB_VER="5.3"
12+
PYTHON_LIB_VER="5.5"
1313
PYTHON_LIB_SUPPORT_PLATFORM="Windows/Linux/macOS/otherOS"
1414
PYTHON_LIB_RELEASE_DATE="9/30/2023, Time: XX:XX"
15-
PYTHON_LIB_LAST_UPDATE_DATE="1/5/2025, Time: 20:43 / 8:43 PM"
15+
PYTHON_LIB_LAST_UPDATE_DATE="2/10/2025, Time: 20:53 / 8:53 PM"
1616
PYTHON_LIB_AUTHOR="LinuxUsersLinuxMint"
1717
PYTHON_LIB_AUTHOR_WEB_SITE="https://linuxuserslinuxmint.github.io"

0 commit comments

Comments
 (0)