1) Which string method would you use to separate a sentence into a list of words? a) strip() b) split() c) join() d) find() 2) What does the find() method return? a) A list of all matching words. b) The highest index of the substring. c) The lowest index of the substring if it is found. d) No correct answer. 3) What is the result of this code? a) ['Python', 'is', 'fun'] b) 'Python is fun' c) 'Pythonisfun' d) No correct answer. 4) What does the index() method return? a) The position of the first occurrence of a substring in a string b) The highest index of the substring inside the string c) The lowest index of the substring if it is found. d) No correct answer. 5) What is a lambda function in Python? a) A small anonymous function defined with the lambda keyword b) A built-in function used to create lists. c) A function that can only be used with loops. d) No correct answer. 6) What is the purpose of the map() function in Python? a) To apply a condition to filter a list b) To apply a function to each item in an iterable and return the results c) To sort a list of strings d) No correct answer. 7) What is the output of this code? a) [1, 4, 9, 16, 25] b) [2, 4, 6, 8, 10] c) [1, 2, 3, 4, 5] d) No correct answer. 8) How does the filter() function work in Python? a) It transforms each element of a list using a given function. b) It filters elements from an iterable based on a function that returns True or False. c) It finds elements that match a specific string. d) No correct answer. 9) What is the output of this code? a) [1, 4, 9, 16, 25] b) [2, 4, 6, 8, 10] c) [2, 4] d) No correct answer. 10) What does the 'return' keyword actually do inside a function? a) Ends the function and outputs a result. b) Prints the result to the screen. c) Stores the result in memory permanently. d) No correct answer.
0%
Python basics
แชร์
แชร์
แชร์
โดย
Kaforyszewska
แก้ไขเนื้อหา
สั่งพิมพ์
ฝัง
เพิ่มเติม
กำหนด
ลีดเดอร์บอร์ด
แสดงเพิ่มขึ้น
แสดงน้อยลง
ลีดเดอร์บอร์ดนี้ตอนนี้เป็นส่วนตัว คลิก
แชร์
เพื่อทำให้เป็นสาธารณะ
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานโดยเจ้าของทรัพยากร
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานเนื่องจากตัวเลือกของคุณแตกต่างสำหรับเจ้าของทรัพยากร
แปลงกลับตัวเลือก
แบบทดสอบ
เป็นแม่แบบแบบเปิดที่ไม่ได้สร้างคะแนนสำหรับลีดเดอร์บอร์ด
ต้องลงชื่อเข้าใช้
สไตล์ภาพ
แบบ อักษร
ต้องสมัครสมาชิก
ตัวเลือก
สลับแม่แบบ
แสดงทั้งหมด
รูปแบบเพิ่มเติมจะปรากฏเมื่อคุณเล่นกิจกรรม
เปิดผลลัพธ์
คัดลอกลิงค์
คิวอาร์โค้ด
ลบ
คืนค่าการบันทึกอัตโนมัติ:
ใช่ไหม