I Haz Codes

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Menu
Using other conditions

Learn

So far we have only explored the == operator. In this session we will look at the other operators and see how they can be used within your programs. This video will also look at character encoding to help understand how we can use greater/less than with text.

Try

You need to write a program which will award a prize if someone gets more than 20 points. The program should –

  1. Ask for the number of points.
  2. If the number is greater or equal to 20 then it should display “you get a prize”.
  3. If it is less than 20 then it should display “you do not get a prize”.

Challenge

Write a program which starts with the code secret = 63 .

The program is to create a single turn secret number guessing game. The user can enter a guess of the secret number. It will display if the guess was correct, too big or too small.

Test

Try the following quiz to test your knowledge.

Tasks to try

Comments are closed.

Information