Notes To (“Python Crash Course”, 2023)

NOTES

  • Two example of quotes used inside a string:
    • ‘ I said to myself “I am ready for lunch!” ‘
    • ” I’m ready for lunch! “
  • Every method is followed by a set of parentheses.
    • Inside the parentheses are additional information so the method can do its action.
    • The parentheses can be left empty if no additional information is needed by the method.
  • To insert a variable’s value into a string:
    • Place the letter f immediately before the opening quotation mark.
    • Put braces around the name or names of variables to be included inside the string.
      • My examples:

Python uses two multiplications symbols to resprsent exponents.

Python supports the order of operations, therefore you can use multiple operations in one expression.

Use parentlheses to modify the order operations.

When you divide ANY two numbers, the result is always a float.

An interger and a float will also give a float result.

Python deflault is a float whenever a float is used, even when the result is a whole number.

Python doesn’t have bulit-in constant types (when you want to treat a variable as a constant in the code, write the variable name in all capital letters.

(“Python Crash Course”, 2023)

Pages: 1 2 3 4