ทำความรู้จักกับภาษา python (14) : การจัดการข้อผิดพลาดใน python (ไพทอน)
Moderators: mindphp, ผู้ดูแลกระดาน
- chatee supasand
- PHP VIP Members
- Posts: 1666
- Joined: 04/06/2019 10:06 am
Re: ทำความรู้จักกับภาษา python (14) : การจัดการข้อผิดพลาดใน python (ไพทอน)
ขอบคุณ ครับเค้าใจเนื้อหาดีมากเลยครับ

- jirawoot
- PHP VIP Members
- Posts: 3130
- Joined: 17/06/2019 10:30 am
Re: ทำความรู้จักกับภาษา python (14) : การจัดการข้อผิดพลาดใน python (ไพทอน)
Code: Select all
try:
a_int = 10 * (5 / 0)
print(a_int)
except:
print('ไม่สามารถหารด้วย 0 ได้')
Code: Select all
import sys
try:
num = int(input('input number 1-10 :'))
except ValueError:
print ("you input the wrong number")
sys.exit()
print('you number is :', num)
-
- Similar Topics
- Replies
- Views
- Last post
-
-
ทำความรู้จักกับภาษา python (23) : การใช้ from...import (ฟอร์ม...อิมพอร์ต) ในภาษา python (ไพทอน)
by dawthana » 12/01/2017 3:24 pm » in Python Knowledge - 9 Replies
- 2559 Views
-
Last post by jirawoot
21/06/2019 10:07 am
-
-
- 8 Replies
- 2422 Views
-
Last post by bolue
09/06/2020 10:22 am
-
-
ทำความรู้จักกับภาษา python (22) : การสร้าง Module (โมดูล) ใน python (ไพทอน)
by dawthana » 12/01/2017 11:33 am » in Python Knowledge - 9 Replies
- 1907 Views
-
Last post by jirawoot
20/06/2019 6:44 pm
-
-
-
ทำความรู้จักกับภาษา python (15) : การสร้างฟังก์ชันใน python (ไพทอน)
by dawthana » 30/12/2016 3:38 pm » in Python Knowledge - 9 Replies
- 1494 Views
-
Last post by jirawoot
20/06/2019 2:49 pm
-
-
-
ทำความรู้จักกับภาษา python (4) : ตัวดำเนินการใน python (ไพทอน)
by dawthana » 28/12/2016 10:05 am » in Python Knowledge - 11 Replies
- 1419 Views
-
Last post by Sirayu
19/06/2019 11:56 am
-
-
-
ทำความรู้จักกับภาษา python (2) : เครื่องมือที่ใช้ในการเขียน python (ไพทอน)
by dawthana » 27/12/2016 7:58 pm » in Python Knowledge - 3 Replies
- 994 Views
-
Last post by chatee supasand
06/06/2019 4:42 pm
-
-
-
ทำความรู้จักกับภาษา python (5) : การกำหนดตัวแปร python (ไพทอน)
by dawthana » 28/12/2016 11:41 am » in Python Knowledge - 7 Replies
- 1744 Views
-
Last post by jirawoot
19/06/2019 1:55 pm
-
-
-
ทำความรู้จักกับภาษา python (1) : ความรู้เกี่ยวกับภาษา python (ไพทอน)
by dawthana » 27/12/2016 1:35 pm » in Python Knowledge - 3 Replies
- 1264 Views
-
Last post by chatee supasand
06/06/2019 3:44 pm
-
Who is online
Users browsing this forum: No registered users and 14 guests