Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A ride needs an age of at least and a height of at least cm. Write the program. Who can ride: (a) age , height ; (b) age , height ; (c) age , height ?
and needs both conditions to be True.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, compare your working with the solution.
Condition. age >= 12 and height >= 140.
True and True is True. Can ride.True and False is False. Cannot ride. Not tall enough.False and True is False. Cannot ride. Too young.Answer: only person (a).
Log in to join the discussion.
Loading…