ผลการสอบ 3 ส่วน

📋 โจทย์

รับคะแนน 3 ส่วน (บรรทัดละ 1): แบบฝึกหัด(เต็ม10), กลางภาค(เต็ม40), ปลายภาค(เต็ม50) แสดง "pass" ถ้าทุกส่วนได้ ≥ 50% หรือ "fail"

⚠️ ข้อจำกัด

0 ≤ แบบฝึกหัด ≤ 10, 0 ≤ กลางภาค ≤ 40, 0 ≤ ปลายภาค ≤ 50

📝 ตัวอย่าง

ตัวอย่างที่ 1
Input:
5
20
25
Output:
pass
ตัวอย่างที่ 2
Input:
4
30
40
Output:
fail
ตัวอย่างที่ 3
Input:
10
40
50
Output:
pass
🔓 ดูเฉลย
hw = int(input())
mid = int(input())
final = int(input())
if hw >= 5 and mid >= 20 and final >= 25:
    print("pass")
else:
    print("fail")

💡 ตรวจว่าทุกส่วนได้ ≥ 50% (hw≥5, mid≥20, final≥25) ใช้ and เชื่อมเงื่อนไขทุกตัว

🐍 main.py

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