Ticket price · Precio de la entrada
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.
Precio de la entrada
age es 30 y member es True. Los miembros pagan 5. Todos los demás pagan 12, o 8 si tienen menos de 18 años. Almacene el precio en price.
Una variable de tipo True/False no necesita una comparación: if member: ya realiza la consulta. Escribir if member == True: también funciona, pero la forma abreviada es la que se utiliza habitualmente en código real.
age is 30 and · y member is True. Members pay 5. Everyone else pays 12, or 8 if they are under 18. Store the price in price. · age es 30 y member es True. Los miembros pagan 5. Todos los demás pagan 12, o 8 si tienen menos de 18 años. Almacena el precio en price.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.