-
Notifications
You must be signed in to change notification settings - Fork 1
/
add_v02.py.orig
222 lines (187 loc) · 4.92 KB
/
add_v02.py.orig
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<<<<<<< HEAD
#hello
import time, sys, os
=======
import time, sys, os
>>>>>>> 75fb77ea58dfecb4e4e856281434ebd9eea08257
w = ("add","sub","mult","div","divn")
set_LANG = ("Wrong number\n",\
"Language selected\n",\
"언어가 설정 되었습니다\n",\
"言語が設定されてい\n","")
<<<<<<< HEAD
setAsk_KOR = ("\n\tCALCULATOR 1.2.2 계산기입니다.",\
"다음을 입력해 주세요",\
"첫번째 숫자:",\
"두번째 숫자:",\
"계산법 (더하기=1,빼기=2,곱하기=3,나누기(소수)=4,나누기=5):",\
"답은",\
"입니다",\
"잘못된 숫자입니다")
def chooLANG():
global lang; lang = 4
=======
'''
# 모든 원소가 0인 5x5리스트 생성
Matrix = [[0]*5 for i in range(5)]
# 인덱스로 접근해서 값 변경
Matrix[0][0] = 1
Matrix[4][0] = 5
#출력
print Matrix[0][0] # prints 1
print Matrix[4][0] # prints 5
'''
# setAsk_KOR[0] = Header
setAsk_LANG = [
["\n\tCALCULATOR 1.2.2 계산기입니다.",\
"\n\tThis is CALCULATOR 1.1.2",\
"\n\tCALCULATOR 1.2.2 計算機です."],\
["다음을 입력해 주세요", "Enter Number", "数字を入力してください"],\
["첫번째 숫자:", "First number:", "最初の数字:"],\
["두번째 숫자:", "Second number", "第二の数字:"],\
["계산법 (더하기=1,빼기=2,곱하기=3,나누기(소수)=4,나누기=5):",\
"Calculation (add=1,sub=2,mult=3,div(float)=4,div=5):",\
"計算 (プラス=1,マイナス=2,乗算=3,除算(小数)=4,除算=5):"],\
["답은", "Answer is", "答えは"],\
["입니다", " ...", "です"],\
["잘못된 숫자입니다", "Wrong Number", "誤った数字です"],\
]
print(setAsk_LANG[4][2])
'''
def chooLANG():
global lang; lang = 4
>>>>>>> 75fb77ea58dfecb4e4e856281434ebd9eea08257
while lang > 3 or lang == 0:
print("Please select language")
lang = (int(input("English=1, 한국어=2 日本語=3 : ")))
if lang >= 1 and lang <=3 : print(set_LANG[lang])
else:
print(set_LANG[0]) # wrong message = 0
time.sleep(2)
os.system('cls')
chooLANG()
def add(a,b):
re = a + b
print(a,"+",b,"=",re)
return re
def sub(a,b):
re = a - b
print(a,"-",b,"=",re)
return re
<<<<<<< HEAD
=======
>>>>>>> 75fb77ea58dfecb4e4e856281434ebd9eea08257
def mult(a,b):
re = a * b
print(a,"*",b,"=",re)
return re
<<<<<<< HEAD
=======
>>>>>>> 75fb77ea58dfecb4e4e856281434ebd9eea08257
def div(a,b):
re = a / b
print(a,"/",b,"=",re)
return re
<<<<<<< HEAD
=======
>>>>>>> 75fb77ea58dfecb4e4e856281434ebd9eea08257
def divn(a,b):
re = a // b
print(a,"//",b,"=",re)
return re
def ask_KOR():
global a,b,c
if lang is 2:
print (setAsk_KOR[0]) # "\n\tCALCULATOR 1.2.2 계산기입니다."
print ("\n","-"*60)
<<<<<<< HEAD
print (setAsk_KOR[1])
a = (int(input(setAsk_KOR[2])))
b = (int(input(setAsk_KOR[3])))
c = (int(input(setAsk_KOR[4])))
def run_KOR():
if c >= 1 and c <=5 : print(setAsk_KOR[5],add(a,b),setAsk_KOR[6]) # 답은~, 입니다.
=======
print (setAsk_KOR[1]) # "다음을 입력해 주세요"
a = (int(input(setAsk_KOR[2]))) # "첫번째 숫자:",\
b = (int(input(setAsk_KOR[3]))) # "두번째 숫자:",\
c = (int(input(setAsk_KOR[4]))) # ""계산법 (더하기=1,빼기=2,곱하기=3,나누기(소수)=4,나누기=5):"\
def run_KOR():
if c >= 1 and c <=5 : print(setAsk_KOR[c],add(a,b),setAsk_KOR[c]) # 답은~, 입니다.
>>>>>>> 75fb77ea58dfecb4e4e856281434ebd9eea08257
else:
print(setAsk_KOR[7]) # 잘못된 숫자입니다 = setAsk_KOR[7]
ask_KOR()
def main():
chooLANG()
if lang == 1:
ask_ENG()
run_ENG()
elif lang == 2:
ask_KOR()
run_KOR()
elif lang == 3:
ask_JAP()
run_JAP()
main()
<<<<<<< HEAD
'''
def ask_ENG():
c = (int(input("Calculation (add=1,sub=2,mult=3,div(float)=4,div=5):")))
if c is 1:
w = add
print("Answer is",w(a,b))
elif c is 2:
w = sub
print("Answer is",w(a,b))
elif c is 3:
w = mult
print("Answer is",w(a,b))
elif c is 4:
w = div
print("Answer is",w(a,b))
elif c is 5:
w = divn
print("Answer is",w(a,b))
else:
print("Wrong number")
askENG()
def run_ENG():
if lang is 1:
print ("\n\tThis is CALCULATOR 1.1.2")
print ("\n","-"*60)
print ("Enter Number")
a = (int(input("First number:")))
b = (int(input("Second number:")))
askENG()
def run_JAP():
elif lang is 3:
print ("\n\tCALCULATOR 1.2.2 計算機です.")
print ("\n","-"*60)
print ("数字を入力してください")
a = (int(input("最初の数字:")))
b = (int(input("第二の数字:")))
ask_JAP()
def ask_JAP():
c = (int(input("計算 (プラス=1,マイナス=2,乗算=3,除算(小数)=4,除算=5):")))
if c is 1:
w = add
print("答えは",w(a,b),"です")
elif c is 2:
w = sub
print("答えは",w(a,b),"です")
elif c is 3:
w = mult
print("答えは",w(a,b),"です")
elif c is 4:
w = div
print("答えは",w(a,b),"です")
elif c is 5:
w = divn
print("答えは",w(a,b),"です")
else:
print("誤った数字です")
ask_JAP()
=======
>>>>>>> 75fb77ea58dfecb4e4e856281434ebd9eea08257
'''