AHS CODING CLUB

Welcome to AHS Code Club Tuesdays

This page will serve as a go to page for lesson, activites and code

Get in Touch
Back to Home Page

Exercises

Exercise 1: Create Variable

On the first line of code, create a new variable named player_health and set it equal to 1000. Print this variable value on second line. On third line reduce value of variable by 100. Print new value on fourth line.

Exercise 2: Input Exercise

Modify the Code from above to Ask User for Their Name and put this value in a Variable. Modify the code to print the user's name along with his health.

Exercise 3: Fix The Code

Fix the bugs in the code. player_health should be an integer and player_has_magic should be a boolean.

player_health = "100"
player_has_magic = "True"
# don't touch below this line
print(f"player_health is a/an {type(player_health).__name__}")
print(f"player_has_magic is a/an {type(player_has_magic).__name__}")

Code Input

Submit Code Here