Get startedGet started for free

Updating variable values

Variables can be updated to possess new values at any time to ensure you can reuse them effectively. Boolean values can only be True or False, similar to Yes/No.

The customer has won the lottery! Update the account_balance and is_millionaire variables to reflect their new status.

This exercise is part of the course

Introduction to Python for Developers

View Course

Exercise instructions

  • Update the account_balance to be 1300000.00.
  • Update the is_millionaire variable to be True.
  • Print the is_millionaire variable to see its updated Boolean value.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

account_balance = 20000.00
is_millionaire = False

# Update account balance
account_balance = ____
# Update is_millionaire variable
____ = ____

print(account_balance)
print(is_millionaire)
Edit and Run Code