wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python_part2

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

ข้อใดไม่ใช่ ชนิดของตัวแปรในภาษาไพทอน

a)

string

b)

Integer

c)

normal

d)

bool

2.

ตัวแปรชนิดใดที่ให้ผลลัพธ์เป็น True หรือ False เท่านั้น

a)

normal

b)

string

c)

float

d)

bool

3.

ข้อใดต่อไปนี้ ตั้งชื่อตัวแปรไม่ถูกต้อง

a)

1_name

b)

_number

c)

no8

d)

hello

4.

ข้อใดต่อไปนี้ ไม่สามารถใช้เป็นชื่อของตัวแปรได้

a)

break

b)

open

c)

close

d)

next

5.

ผลลัพธ์ของนิพจน์ 7 + 2 * 3 – 1 + 5 % 2 คือข้อใด

a)

9

b)

13

c)

1

d)

5

6.

ผลลัพธ์ของนิพจน์ 5 ** 2 – 6 // 4 คือข้อใด

a)

4

b)

1

c)

24

d)

0

7.

กำหนดให้ x = 10 คำสั่งแสดงผลข้อใดใช้ไม่ถูกต้อง

a)

print(“Hello World\t”)

b)

print(x)

c)

print(“Number is ”x)

d)

print(x+x)

8.

กำหนดให้ name = “Hello” คำสั่งแสดงผลข้อใดใช้ไม่ถูกต้อง

a)

print(name)

b)

print(name + name)

c)

print(name - name)

d)

print(name + “Hello”)

9.

ข้อใดคือการรับค่าตัวแปรประเภทตัวเลขจำนวนจริง

a)

x = int(input())

b)

x = float(input())

c)

x = input()

d)

x = number(input())

10.

หากนักเรียนต้องการใช้ฟังก์ชันทางคณิตศาสตร์ นักเรียนจะต้องทำการเขียนคำสั่งใดก่อนเสมอ

a)

include math

b)

input math

c)

import math

d)

implement math