
แบบทดสอบที่ 5 เรื่องการรับค่าในภาษาไพทอน (รายกลุ่ม)
Authored by นางสาวมูณีเราะห์ มะนุง
Computers
7th Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
ข้อใดคือคำสั่งรับค่าในภาษา Python
int()
input()
print()
ipod()
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
ค่าที่ได้เมื่อใช้ฟังก์ชัน input() จะเป็นข้อมูลชนิดใด
Integer / int
Float
String
ถูกทุกข้อ
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
จากโค้ดคำสั่งต่อไปนี้ ค่าของตัวแปร age เป็นข้อมูลชนิดใด
age = input("คุณอายุเท่าไหร่")
Integer / int
Float
String
ถูกทุกข้อ
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
จากโค้ดคำสั่งต่อไปนี้ จะเกิด Error หรือไม่ และเพราะเหตุใด
age = input("คุณอายุเท่าไหร่")
age = age + 20
Error เพราะผู้ใช้ไม่ระบุอายุ
Error ตัวแปร age เป็นชนิดข้อมูล String ทำให้ไปบวก 20 ไม่ได้
ไม่ Error แต่ผู้ใช้ต้องระบุอายุ
ไม่ Error รันผ่านได้ปกติ
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
จากโค้ดคำสั่งต่อไปนี้ ควรเติมคำสั่งใดที่บรรทัดที่ 2 เพื่อไม่ให้เกิด Error
1.age = input("คุณอายุเท่าไหร่")
2._______________________________
3.age = age + 20
age = int(age)
age = int(20)
age = int(input())
age = str(age)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
จากโค้ดคำสั่งต่อไปนี้ หากผู้ใช้ป้อนค่า 45.5 ค่าดังกล่าวจะถูกเก็บในตัวแปรใด
w = input("ระบุน้ำหนักของคุณ (ใส่ทศนิยมได้)")
ตัวแปร w
ตัวแปร input
ตัวแปร age
ข้อ 1 และ 2 ถูกต้อง
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
จากโค้ดคำสั่งต่อไปนี้ หากผู้ใช้ป้อนค่า 45.5 ค่าดังกล่าวจะเป็นข้อมูลชนิดใด
w = input("ระบุน้ำหนักของคุณ (ใส่ทศนิยมได้)")
Integer/int
String/str
Float
ผิดทุกข้อ
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?