LoslegenKostenlos loslegen

Assignment and equality

When looking at someone's wealth, a distinction between cash and non-cash securities is important. Savings and checking accounts are cash securities. Stock positions are non-cash. Imagine that as part of balancing a client's wealth portfolio, you are asked to compare their cash and non-cash securities. The variable non_cash is provided with the value of the non-cash securities.

Diese Übung ist Teil des Kurses

Intermediate Python for Finance

Kurs anzeigen

Anleitung zur Übung

  • Assign a value of 19.11 to the variable cash.
  • Check if cash and non_cash have the same value.
  • Assign to cash the value of non_cash.
  • Confirm that cash and non_cash are equal.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Assign a value to cash.
____ ____ ____

# Check if cash is equal to non-cash
print(____ ____ ____)

# Assign the value of cash to be equal non-cash
____ ____ ____

# Check if cash is equal to non-cash
print(____ ____ ____)
Code bearbeiten und ausführen