wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

ทดสอบภาษาไพทอนเบื้องต้น

Total questions: 30

Worksheet time: 30mins

Name
Class
Date
1.

ข้อใด คือ ฟังก์ชันในภาษาไพทอน

a)

print()

b)

scan()

c)

output()

d)

process()

2.

ในภาษาไพทอน ฟังก์ชันใดใช้ในการแสดงข้อความออกทางจอภาพ

a)

display

b)

print

c)

printf

d)

output

3.

คำสั่ง print ในภาษา python คือคำสั่งตามข้อใด

a)

คำสั่งรับข้อมูลทางแป้นพิมพ์

b)

คำสั่งตรวจสอบชนิดตัวแปร

c)

คำสั่งแสดงข้อมูล

d)

คำสั่งกำหนดค่า

4.

หากต้องการให้แสดงผลเป็นข้อความ ต้องใช้สัญลักษณ์ใด

a)

"

b)

#

c)

+

d)

*

5.

print("5+5","and",5+5) มีค่าเท่าใด

a)

"5+5" and 10

b)

"5+5" and 5+5

c)

5+5 and 5+5

d)

5+5 and 10

6.

ข้อมูลประเภทข้อความ เรียกว่าอะไร

a)

float

b)

string

c)

integer

d)

number

7.

ข้อมูลประเภทจำนวนเต็ม เรียกว่าอะไร

a)

integer

b)

number

c)

float

d)

string

8.

ข้อมูลประเภทจำนวนจริง เรียกว่าอะไร

a)

integer

b)

number

c)

float

d)

string

9.

"7*3=21" จัดเป็นข้อมูลชนิดใด

a)

float

b)

string

c)

integer

d)

number

10.

-12.12 จัดเป็นข้อมูลชนิดใด

a)

string

b)

float

c)

integer

d)

number

11.

ผลลัพธ์ คือ ไทยไทยไทย

ต้องเขียนคำสั่งว่ายังไง

a)

love=ไทย+ไทย+ไทย

b)

love="ไทย+ไทย+ไทย"

c)

love="ไทย"

d)

love="ไทย" * 3

12.

ผลลัพธ์ของคำสั่งต่อไปนี้ print(8%2)

a)

0

b)

1

c)

2

d)

3

13.

ผลลัพธ์ของคำสั่ง print(3+7*2)

a)

12

b)

17

c)

20

d)

25

14.

ข้อใดคือผลลัพธ์ของ Code ต่อไปนี้?

print("Hello world!")

a)

SyntaxError

b)

Hello world!

c)

print(Hello world!)

d)

"Hello world!"

15.

ข้อใดคือผลลัพธ์ของ Code ต่อไปนี้?

print(3+4)

a)

3+4

b)

7

c)

print(3+4)

d)

SyntaxError

16.

ข้อใดคือผลลัพธ์ของ Code ต่อไปนี้?

print(3*4)

a)

34

b)

7

c)

12

d)

3*4

17.

ข้อใดคือผลลัพธ์ของ Code ต่อไปนี้?

print(9/3)

a)

3

b)

3.3

c)

9/3

d)

SyntaxError

18.

ของใดคือคอมเม้นบน Code โปรแกรม

a)

#

b)

%

c)

**

d)

()

19.

ข้อใดกำหนดค่าให้ตัวแปรได้ถูกต้อง?

a)

my_variable = 10

b)

my variable = 10

c)

my_variable: 10

d)

my_variable is 10

20.

ข้อใดคือผลลัพธ์ของ Code ต่อไปนี้?

print("3+4")

a)

7

b)

3+4

c)

34

d)

SyntaxError

21.

n=3

print("n=", n)

a)

SyntaxError

b)

n=n

c)

n=3

d)

print('n=',n)

22.

n=3

m=10

print("n=", m)

a)

SyntaxError

b)

n=m

c)

n=3

d)

n=10

23.

n=3

m=10

y=2

m % n = มีค่าเท่าไร

a)

1

b)

2

c)

3

d)

4

24.

n=3

m=10

y=2

m / y = มีค่าเท่าไร

a)

3

b)

4

c)

5

d)

6

25.

print("Grade", 5+2)

a)

Grade 5+2

b)

Grade 7

c)

Grade7

d)

Grade5+2

26.

a = 5

b = 10

if a>=10

print(a)

else

print(b)


ข้อใดคือผลลัพธ์

a)

print(a)

b)

print(b)

c)

5

d)

10

27.

m = 5

n = 10

if n>=10

print("AA")

else

print("BB")


ข้อใดคือผลลัพธ์

a)

print("AA")

b)

print("BB")

c)

AA

d)

BB

28.

name="jhong"

age = 30

print("----")


ข้อใดคือผลลัพธ์

a)

print("----")

b)

age = 30

c)

----

d)

name="jhong"

29.

จงบอกผลลัพธ์ที่ได้ของ โค๊ดต่อไปนี้

a=int(input())

b=int(input())

c=a+b

print(c)

a)

ไม่สามารถ รันได้

b)

รับค่าแต่ไม่แสดงผลลัพธ์ใดๆ

c)

รับค่า a และ b แต่ไม่แสดงผล c

d)

รับค่า a และ b จากนั้นรวมกันแล้วแสดงผล c

30.

+ - * / เป็นตัวดำเนินการประเภทใด

a)

ตัวดำเนินการเปรียบเทียบ

b)

ตัวดำเนินการทางตรรกะ

c)

ตัวดำเนินการสมาชิก

d)

ตัวดำเนินการทางคณิตศาสตร์