wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

แบบทดสอบหลังเรียน Python Basic

Total questions: 16

Worksheet time: 13mins

Name
Class
Date
1.

int คือชนิดข้อมูลแบบข้อใด

a)

ข้อความ

b)

ตัวเลขจำนวนเต็ม

c)

ตัวเลขทศนิยม

d)

จำนวนจินตภาพ

2.

float คือชนิดข้อมูลแบบข้อใด

a)

ข้อความ

b)

ตัวเลขจำนวนเต็ม

c)

ตัวเลขทศนิยม

d)

จำนวนจินตภาพ

3.

str คือชนิดข้อมูลแบบข้อใด

a)

ข้อความ

b)

ตัวเลขจำนวนเต็ม

c)

ตัวเลขทศนิยม

d)

จำนวนจินตภาพ

4.

Hello world

This is my name

ข้อใดคือ code ที่ถูกต้อง

a)

x = Hello world

y=This is my name

print(x)

print(y)

b)

x = "Hello world"

y="This is my name"

print[x]

print[y]

c)

a = 'Hello world'

b='This is my name'

print(a)

print(b)

d)

a = 'Hello world'

b='This is my name'

print[x]

print[y]

5.

a=500

print(a)

print(type(a))

ข้อใดตอบถูกต้อง

a)

500.00

int

b)

500

int

c)

500.00

float

d)

500

float

6.

d=3.55

print(d)

print(type(d))

ข้อใดตอบถูกต้อง

a)

3.55

int

b)

35

int

c)

3.55

float

d)

35.5

float

7.

a = "1.265"

print (type(a))

a = int(1.265)

print (type(a))

สุดท้ายแล้วตัวแปร a จะมีชนิดข้อมูลตามข้อใด

a)

int

b)

float,

c)

str

d)

complex

8.

print(30+5)

n=30+5

print(n)

ให้นักเรียนพิมพ์คำตอบต่อกันไปไม่ต้องเว้นช่องว่าง

(a)  

9.

num = '34'+'4'

print (num)

ให้นักเรียนพิมพ์คำตอบต่อกันไปไม่ต้องเว้นช่องว่าง

(a)  

10.

float คือชนิดข้อมูลแบบข้อใด

a)

ข้อความ

b)

ตัวเลขจำนวนเต็ม

c)

ตัวเลขทศนิยม

d)

จำนวนจินตภาพ

11.

str คือชนิดข้อมูลแบบข้อใด

a)

ข้อความ

b)

ตัวเลขจำนวนเต็ม

c)

ตัวเลขทศนิยม

d)

จำนวนจินตภาพ

12.

a = "1280"

print (type(a))

a = float(1280)

print (type(a))

ข้อใดถูกต้อง

a)

str

b)

int

c)

float

d)

complex

13.

x = "1280"

x = float(1280)

print (type(x))

ให้นักเรียนตอบสั้นๆ เช่น int, float, strหรือ complex

(a)  

14.

คำสั่งที่ใช้แสดงผลในภาษา python คือข้อใด

a)

input

b)

printf

c)

print

d)

output

15.

คำสั่งที่ใช้แสดงผลชนิดข้อมูลในภาษา python คือข้อใด

a)

input(type())

b)

print(type())

c)

output(type())

16.

a = "600"

print (type(a))

หากต้องการเปลี่ยนให้เป็นเลขทศนิยมต้องเขียนคำสั่งตามข้อใด

a)

a = "600"

print (type(a))

a=int(600)

print (type(a))

b)

a = "600"

print (type(a))

a=float(600)

print (type(a))

c)

a = "600"

print (type(a))

a=str(600)

print (type(a))

d)

a = "600"

print (type(a))

a=600

print (type(a))