random.choice จากรายการ

📋 โจทย์

รับ seed s แล้วรายการคำคั่นด้วยช่องว่างหนึ่งบรรทัด ตั้ง seed แล้วพิมพ์ random.choice ของรายการนั้น

⚠️ ข้อจำกัด

มีอย่างน้อย 1 คำ

📝 ตัวอย่าง

ตัวอย่างที่ 1
Input:
1
apple banana cherry
Output:
apple
🔓 ดูเฉลย
import random
s=int(input())
items=input().split()
random.seed(s)
print(random.choice(items))
🐍 main.py

กด Run เพื่อรันโค้ด หรือ ตรวจคำตอบ เพื่อตรวจ test cases