Cards (52)

  • What are the parts of the first program?
    Word print, parentheses, quotation marks, line
  • What does the word print represent in the program?
    It is a function name.
  • What is a function in programming?
    A separate part of the computer code.
  • What can a function cause in programming?
    It can send text to the terminal.
  • How do Python functions relate to mathematical concepts?
    They evaluate values like mathematical functions.
  • What forms the function invocation in Python?
    Function name, parentheses, and arguments.
  • What do quotes do in a string in Python?
    They assign a different meaning to the code.
  • What happens to data inside quotes in Python?
    It is taken literally, not as code.
  • What is prohibited in a single line of Python code?
    Having more than one instruction.
  • What is an exception to the rule about instructions in Python?
    One instruction can spread across multiple lines.
  • What does an empty print() invocation output?
    An empty line or a newline.
  • What is the escape character in Python?
    The backslash (\).
  • What does the escape character do in a string?
    It introduces a special inclusion.
  • What does the letter 'n' after the backslash represent?
    Newline.
  • What is a newline character?
    A special symbol urging a new output line.
  • What must you do to include a single backslash in a string?
    Double it (\\).
  • What happens if you use a single backslash incorrectly?
    It will cause an error.
  • How are arguments separated in the print() function?
    By commas.
  • What role do commas play in the print() function?
    They are part of Python's syntax.
  • What does the print() function do with multiple arguments?
    Outputs them all on one line.
  • How does the print() function separate outputted arguments?
    It puts a space between them automatically.
  • What is a keyword argument in Python?
    It consists of a keyword, equal sign, and value.
  • Where must keyword arguments be placed in a function?
    After the last positional argument.
  • What does the default behavior of the end keyword argument do?
    It is implicitly set to end="\n".
  • What happens when the end argument is set to an empty string?
    No newlines are sent to the output.
  • What can the string assigned to the end keyword argument be?
    Of any length.
  • What does the sep keyword argument do in the print() function?
    It changes how arguments are separated.
  • What can the sep argument's value be?
    It may be an empty string.
  • Can keyword arguments be mixed in one invocation?
    Yes, they can be mixed.
  • What is a literal in programming?
    Data whose values are determined by itself.
  • What are the two types of literals mentioned?
    String and integer number.
  • How are strings and integers stored in memory?
    Strings are series of letters; integers are bits.
  • What types of numbers do modern computers handle?
    Integers and floating-point numbers.
  • How do you code negative numbers in Python?
    By adding a minus sign.
  • What are floating-point numbers designed to represent?
    Numbers with a non-empty decimal fraction.
  • How can you write the value of zero point four in Python?
    As 0.4.
  • What happens if you omit zero in front of or after the decimal point?
    You can omit it when it's the only digit.
  • How does Python treat the numbers 4 and 4.0?
    4 is an integer; 4.0 is a float.
  • What notation can be used for very large or small numbers?
    Scientific notation.
  • How is scientific notation represented in Python?
    Using E or e for exponent.