Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

แบบทดสอบวิชาภาษา Python สำหรับมหาลัยปี1

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Python เป็นภาษาโปรแกรมชนิดใด?

a)

Object-Oriented Language

b)

Markup Language

c)

Database Language

d)

Scripting Language

2.

การใช้ # ใน Python มีหน้าที่อะไร?

a)

ใช้สำหรับสร้างลูป

b)

ใช้สำหรับสร้างฟังก์ชัน

c)

ใช้สำหรับสร้างตัวแปร

d)

การ comment หรือเป็น annotation ในโค้ด

3.

ใน Python, การใช้ print() จะทำอะไร?

a)

คำนวณค่า

b)

เปิดไฟล์

c)

สร้างตัวแปรใหม่

d)

แสดงข้อความหรือข้อมูลที่ต้องการบนหน้าจอ

4.

จงอธิบายคำว่า 'SyntaxError' ใน Python

a)

SyntaxError is a type of error that occurs when the code is executed on a non-Python platform.

b)

SyntaxError is a warning message that can be ignored during code execution.

c)

SyntaxError is a type of error that occurs when the parser encounters a syntax that does not conform to the language grammar rules.

d)

SyntaxError is a result of incorrect indentation in Python code.

5.

ใน Python, การใช้ '==' มีหน้าที่อะไร?

a)

การเปรียบเทียบค่าของสองคลาส

b)

การเปรียบเทียบค่าของสองฟังก์ชัน

c)

การเปรียบเทียบค่าของสองลิสต์

d)

การเปรียบเทียบค่าของสองตัวแปร

6.

ใน Python, การใช้ 'for' loop มีหน้าที่อะไร?

a)

การเปลี่ยนแปลงค่าของตัวแปร

b)

การสร้างตัวแปร

c)

การเรียกใช้ฟังก์ชัน

d)

การทำซ้ำคำสั่ง

7.

คำสั่ง 'input()' ใน Python มีหน้าที่อะไร?

a)

It is used to import external libraries in Python.

b)

It is used to take user input from the console.

c)

It is used to define a function in Python.

d)

It is used to print output to the console.

8.

ใน Python, การใช้ 'len()' มีหน้าที่อะไร?

a)

To check if a container is empty

b)

To add a new item to a container

c)

To reverse the order of items in a container

d)

To return the number of items in a container

9.

คำสั่ง 'range()' ใน Python มีหน้าที่อะไร?

a)

Generate a sequence of numbers

b)

Sort a list of strings alphabetically

c)

Generate a random string

d)

Calculate the square root of a number

10.

การใช้ 'if' และ 'else' ใน Python มีหน้าที่อะไร?

a)

if และ else ใช้ใน Python เพื่อการเชื่อมโยงข้อมูล

b)

if และ else ใช้ใน Python เพื่อควบคุมการทำงานของโปรแกรมตามเงื่อนไขที่กำหนด

c)

if และ else ใช้ใน Python เพื่อสร้างฟังก์ชัน

d)

if และ else ใช้ใน Python เพื่อสร้างลูป