Objectives

Students will be able to:

  • understand that only one variable is required to track a particular piece of data whose value may change
  • understand that we can count something by incrementing a variable by 1

Counting

Chances remaining - 10

mAyB A-B

 

Score: 0

Scenario

In a cool computer game, mAy-B A-B, the computer challenges a player to press 'a' or 'b' on the keyboard.

If the player presses the same key that the computer has secretly selected, the player gets a point!

10 rounds are played and finally the player's score is evaluated.

Copy the starter code into a new .py file and open the Worksheet. Complete the tasks.

When attempting to code the tricky challenge, use any strategy to help you including:

  • your own ingenuity
  • sharing ideas with team mates
  • asking a search engine for help
  • asking AI for a suggestion.

Submission

Submit your worksheet and PDF file as instructed.

Tags

iterateauto-indent variablecompile sum machine code count-controlled loop integer pseudocodesyntax