Skip to content · ⁨ข้ามไปยังเนื้อหา⁩

Grade letter · ⁨เกรดตัวอักษร⁩

English

Grade letter

mark is 72. Print A for 80 and above, B for 70 to 79, C for 60 to 69, and D below that.

Order matters. Because Python stops at the first true test, checking >= 60 first would give C to every good mark. Start at the top and work down.

ไทย

حرفเกรด

mark คือ 72. พิมพ์ A สำหรับ 80 ขึ้นไป, B สำหรับ 70 ถึง 79, C สำหรับ 60 ถึง 69, และ D ต่ำกว่านั้น

ลำดับมีความสำคัญ เพราะ Python หยุดที่การทดสอบที่เป็นจริงครั้งแรก หากเริ่มตรวจสอบ >= 60 ก่อน จะทำให้คะแนนดีทุกคะแนนถูกจัดอยู่ในกลุ่ม C ควรเริ่มจากบนลงล่าง

Log in or create account · ⁨เข้าสู่ระบบหรือสร้างบัญชี⁩

IGCSE, A-Level & AP