Categories
Easy Problems

โจทย์เขียนโปรแกรมข้อ VZ0064

จงเขียนฟังก์ชั่นที่รับค่า array ของ string เข้าไป แล้วส่ง array ใหม่ที่มีสมาชิกตัวแรก และตัวสุดท้ายของ array ตัวแรกนั้นออกมา

Examples
firstLast([“one”,”two”]) ➞ [“one”,”two”]

firstlast([“people”,”13″,”person”]) ➞ [“people”,”person”]

firstlast([“zero”]) ➞ [“zero”]

เฉลย ด้วยภาษา Python

Leave a Reply