1) การสร้างลูปในPythonใช้คำสั่งอะไร? a) import b) function c) print d) ใช้for หรือ while 2) ฟังก์ชันใดใช้ในการแสดงผลข้อมูลในPython a) display( ) b) echo( ) c) print( ) d) output( ) 3) print(5*4) จากโค้ดข้างต้นผลลัพธ์คือข้อใด a) 20 b) 10 c) 4*5 d) Error 4) print("ba"+"na"*3) จากโค้ดผลลัพธ์คือข้อใด a) bananana b) bana3 c) bana d) banana 5) คำสั่งใดใช้เพื่อออกจากลูปในPythonก่อนครบเงื่อนไข a) continue b) ิิbreak c) pass d) exit 6) 8+12/2 ได้ผลลัพธ์ตามข้อใด a) 10 b) 22 c) 14 d) 0 7) โมดูลใดใช้ในการจัดการกับคณิตศาสตร์ในPython a) statistics b) math c) random d) os 8) 3+4//2+2**2**3*(30/6)-1 ได้ผลลัพธ์ตามข้อใด a) 1280 b) 1288 c) 1284 d) 1287 9) ฟังก์ชันใดใช้ในการแปลงค่าข้อมูลประเภท string เป็น int? a) include b) use c) import d) require 10) ฟังก์ชัน range(5) สร้างอะไรใน Python? a) [0, 1, 2, 3, 4, 5] b) [1, 2, 3, 4, 5] c) [0, 1, 2, 3, 4] d) [1, 2, 3, 4] 11) คำสั่งใดใช้ในการนำเข้าฟังก์ชันจากไลบรารีอื่น? a) import b) include c) require d) use 12) คำสั่งใดใช้ในการพิมพ์ข้อความใน Python? a) echo b) printf c) cout d) print() 13) ข้อใดคือค่าที่คืนกลับจากฟังก์ชัน len([1, 2, 3, 4])? a) 3 b) 6 c) 5 d) 4 14) ข้อใดไม่ใช่ประเภทข้อมูลใน Python? a) int b) float c) list d) array 15) คำสั่งใดใช้ในการตรวจสอบว่าตัวแปร x มีค่าเป็น None หรือไม่? a) while b) if c) def d) for 16) ผลลัพธ์ของการรันคำสั่ง 2 ** 3 คืออะไร? a) 6 b) 9 c) 12 d) 8 17) ข้อใดคือวิธีการสร้างคอมเมนต์ใน Python? a) // คอมเมนต์ b) /* คอมเมนต์ */ c) # คอมเมนต์ d) ! คอมเมนต์ 18) ตัวดำเนินการใดใช้สำหรับการเชื่อมสตริงใน Python? a) + b) & c) | d) * 19) ข้อใดเป็นตัวแปรประเภททูเพิล (tuple)? a) x = [1, 2, 3] b) x = {1, 2, 3} c) x = (1, 2, 3) d) x = {key: value} 20) ผลลัพธ์ของ 10 // 3 ใน Python คืออะไร? a) 3.33 b) 3 c) 4 d) dError
0%
แบบทดสอบPython
Share
Share
Share
by
Std30546
Edit Content
Print
Embed
More
Assignments
Leaderboard
Show more
Show less
This leaderboard is currently private. Click
Share
to make it public.
This leaderboard has been disabled by the resource owner.
This leaderboard is disabled as your options are different to the resource owner.
Revert Options
Spin the wheel
is an open-ended template. It does not generate scores for a leaderboard.
Log in required
Visual style
Fonts
Subscription required
Options
Switch template
Show all
More formats will appear as you play the activity.
Open results
Copy link
QR code
Delete
Continue editing:
?