1) Which of the following is a valid variable name in Python? a) 2name b) my_name c) class d) print 2) "What will this code print? a) HelloWorld b) Hello + World c) Hello World d) Error 3) Which method makes a string all uppercase? a) .upper() b) .capitalize() c) .lower() d) .replace() 4) True or False: A variable name in Python can include spaces. a) TRUE b) FALSE 5) True or False: The len() function can be used to count the number of characters in a string. a) TRUE b) FALSE 6) True or False: Functions in Python must always return a value. a) TRUE b) FALSE 7) "Fill in the blank to get the first character of the string word: a) 0 b) 2 c) 3 d) 1 8) Which of the following is NOT a valid Python data type? a) int b) str c) real d) list 9) "What will this code output? a) ALICE b) alice c) Alice d) Error 10) Which operator is used for exponentiation in Python? a) ^ b) ** c) exp() d) // 11) "What will this code print? a) 2 b) 2.5 c) 3 d) Error 12) True or False: Strings in Python are immutable. a) TRUE b) FALSE 13) Which function is used to find the length of a list or string? a) count() b) size() c) len() d) length() 14) Fill in the blank: The keyword used to return a value from a function is _____. a) return b) yield c) send d) output 15) Which method removes whitespace from both ends of a string? a) strip() b) trim() c) cut() d) split() 16) "What will this code print? a) y b) t c) P d) Error 17) Fill in the blank: To take input from the user, we use the _____ function. a) input() b) read() c) scan() d) ask() 18) "What will this code output? a) 10 b) 55 c) Error 19) Fill in the blank: The built-in function to convert a string to an integer is _____. a) int() b) str() c) float() d) convert() 20) True or False: In Python, you can assign multiple variables in one line. a) TRUE b) FALSE
0%
Variable, Strings, Methods, Functions
แชร์
แชร์
แชร์
โดย
Theudysmejiaper
10th Grade
Computing
แก้ไขเนื้อหา
สั่งพิมพ์
ฝัง
เพิ่มเติม
กำหนด
ลีดเดอร์บอร์ด
แสดงเพิ่มขึ้น
แสดงน้อยลง
ลีดเดอร์บอร์ดนี้ตอนนี้เป็นส่วนตัว คลิก
แชร์
เพื่อทำให้เป็นสาธารณะ
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานโดยเจ้าของทรัพยากร
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานเนื่องจากตัวเลือกของคุณแตกต่างสำหรับเจ้าของทรัพยากร
แปลงกลับตัวเลือก
แบบทดสอบ
เป็นแม่แบบแบบเปิดที่ไม่ได้สร้างคะแนนสำหรับลีดเดอร์บอร์ด
ต้องลงชื่อเข้าใช้
สไตล์ภาพ
แบบ อักษร
ต้องสมัครสมาชิก
ตัวเลือก
สลับแม่แบบ
แสดงทั้งหมด
รูปแบบเพิ่มเติมจะปรากฏเมื่อคุณเล่นกิจกรรม
เปิดผลลัพธ์
คัดลอกลิงค์
คิวอาร์โค้ด
ลบ
คืนค่าการบันทึกอัตโนมัติ:
ใช่ไหม