Skip to content

Commit f692a0e

Browse files
committed
2 parents ffbbeed + 68196c4 commit f692a0e

5 files changed

Lines changed: 60 additions & 3 deletions

File tree

examples/th/.gitkeep

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/th/color.tpy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
สี = ป้อนค่า('กรอกสี:')
2+
3+
จับคู่ สี:
4+
กรณี 'แดง':
5+
แสดงผล('หยุด!')
6+
กรณี 'เหลือง':
7+
แสดงผล('ช้าลง!')
8+
กรณี 'เขียว':
9+
แสดงผล('ไป!')
10+
กรณี _:
11+
แสดงผล('ไม่รู้จักสี!')

examples/th/fibonacci.tpy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
กำหนด ฟีโบนักชี(น: จำนวนเต็ม):
2+
ถ้า น <= 1:
3+
คืนค่า น
4+
มิฉะนั้น:
5+
คืนค่า ฟีโบนักชี(น - 1) + ฟีโบนักชี(น - 2)
6+
7+
จำนวน: จำนวนเต็ม = จำนวนเต็ม(ป้อนค่า('กรอกหมายเลข: '))
8+
แสดงผล(ฟีโบนักชี(จำนวน))

examples/th/prime_checker.tpy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
กำหนด จำนวนเฉพาะ(น: จำนวนเต็ม):
2+
ถ้า น <= 1:
3+
คืนค่า เท็จ
4+
5+
วนซ้ำ จ ใน ช่วง(2, น):
6+
ถ้า น % จ == 0:
7+
คืนค่า เท็จ
8+
คืนค่า จริง
9+
10+
จำนวน: จำนวนเต็ม = จำนวนเต็ม(ป้อนค่า('กรอกหมายเลข: '))
11+
แสดงผล(จำนวนเฉพาะ(จำนวน))

thai.csv

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
None,ไม่มี
2+
int,จำนวนเต็ม
3+
float,ทศนิยม
4+
str,ข้อความ
5+
bool,ตรรกะ
6+
True,จริง
7+
False,เท็จ
8+
if,ถ้า
9+
elif,ถ้าอีก
10+
else,มิฉะนั้น
11+
while,ขณะ
12+
break,หยุดทำ
13+
continue,ทำต่อไป
14+
for,วนซ้ำ
15+
return,คืนค่า
16+
print,แสดงผล
17+
input,ป้อนค่า
18+
match,จับคู่
19+
case,กรณี
20+
try,ลองทำ
21+
except,ยกเว้น
22+
raise,แจ้งข้อผิดพลาด
23+
class,แบบ
24+
self,ตนเอง
25+
def,กำหนด
26+
in, ใน
27+
range,ช่วง
28+
not , ไม่
29+
and , และ
30+
or , หรือ

0 commit comments

Comments
 (0)