Skip to content · ⁨Bỏ qua nội dung⁩

Ticket price · ⁨Giá vé⁩

English

Ticket price

age is 30 and member is True. Members pay 5. Everyone else pays 12, or 8 if they are under 18. Store the price in price.

A True/False variable needs no comparison: if member: already asks the question. Writing if member == True: works too, but the short form is what you will see in real code.

Tiếng Việt

Giá vé

age là 30 và member là True. Thành viên trả 5. Mọi người khác trả 12, hoặc 8 nếu họ dưới 18. Lưu giá vé vào price.

Một biến True/False không cần so sánh: if member: đã trực tiếp hỏi câu hỏi. Việc viết if member == True: cũng hoạt động, nhưng dạng rút gọn là những gì bạn sẽ thấy trong code thực tế.

Log in or create account · ⁨Đăng nhập hoặc tạo tài khoản⁩

IGCSE, A-Level & AP