Study

HS Python coding vocab

  •   0%
  •  0     0     0

  • specifies code that should be run no matter what happens in the "try", "except" or "else" blocks
    last
    final
    lastly
    finally
  • used to modify a variable that isn't defined in a function but in a global scope
    scope
    modify
    define
    global
  • works like "if" statement but can only be used after an "if" or another of the same statement
    else if
    ElseIf
    elif
    Elif
  • defines a function without a name and with only 1 statement
    lambda
    Delta
    Lambda
    delta
  • Starts a conditional statement if the statement is true.
    if
    Then
    IF
    then
  • Used with import to bring in something from a specific module.
    and
    from
    with
    next
  • Gives the opposite Boolean value of a variable
    not
    Not
    Other
    other
  • used to define a function or method of class
    def
    Define
    define
    DEF
  • code that might raise an exception
    next
    do
    except
    try
  • Loop word, if conditions that follow are truthy, using this keyword will keep its statement running over and avoer
    while
    when
    When
    While
  • Used to determine if both left and righ operands are truthy or falsy
    both
    BOTH
    and
    AND
  • Boolan statement, opposite of true
    False
    false
    not
    fulse
  • results in a no-op if the expression is truthy or an "AssertionError" if the expression is falsy
    assert
    error
    true
    express
  • Defines a class in python, powerful in object-oriented programming
    Class
    Group
    group
    class
  • used to modify a variable that isn't defined in a function but from a parent scope
    local
    global
    nonlocal
    parent
  • Exits a loop early
    Stop
    BREAK
    break
    stop
  • raises an exception
    lifts
    raise
    top
    raises
  • Stops the current loop and moves to next step
    CONTINUE
    NEXT
    continue
    Next
  • Used with "import" and "from" to change the name of what is being imported
    as
    change
    switch
    alias
  • containmennt check, is a element included in the data
    in
    with
    out
    included
  • indicates a block intentionally left blank
    Skip
    Pass
    skip
    pass
  • Context manager, defines code to be executed within the context manager's scope.
    WITHIN
    within
    with
    WITH
  • An empty string of code
    none
    blanck
    blank
    None
  • Most common loop, often used with "in"
    FOR
    loop
    for
    Loop
  • Used to include a module into your Python program
    IMPORT
    import
    Bringin
    bringin
  • Denotes blocks of code that should be run when "if" and "elif" statements are falsy
    else
    Else
    Elsethen
    ELSETHEN
  • defines the point in the function where control is given back to the event loop
    back
    await
    stop
    event
  • valid only when used with "def"; exits the function and returns the results
    return
    Return
    Back
    BACK
  • returns a "generator" from a function
    yeild
    YEILD
    yield
    Yield
  • remove indexes from a list or dictionary, or unsets a variable
    remove
    delete
    del
    rid
  • Used with "try" to define what happens when specific exceptions are raised
    continue
    expand
    go
    except
  • Object identity check: determines if 2 objects are exactly the same.
    si
    is
    IS
    Is
  • Boolean statement: opposite of false.
    True
    yes
    true
    tru
  • Connects 2 expressions and evaluates for true or false
    Or
    ore
    OR
    or
  • defines an asynchronous function
    async
    asynchronous
    asynch
    sync