1. Home
  2. Explore
  3. Computer Science
  4. Python for Data Science

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Python for Data Science

  • 52Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Problem Solving & Algorithms
A step-by-step solution for a problem that works for every instance is called an
.

52 questions

  1. 1
    A step-by-step solution for a problem that works for every instance is called an
    _____
    .
    Hint

    Think about the term used for a general procedure that can be applied repeatedly.

    Answer

    algorithm

  2. 2
    A structured way to express an algorithm using keywords and indentation, without relying on a specific programming language, is called
    _____
    .
    Hint

    It is a halfway between plain English and actual code.

    Answer

    pseudocode

  3. 3
    In a flowchart, the start and end of a procedure are represented using
    _____
    shapes.
    Hint

    These are the shapes that look like ellipses or rounded rectangles.

    Answer

    oval

  4. 4
    The process of repeatedly executing a set of steps until a condition is met is called a
    _____
    .
    Hint

    It allows repetition in algorithms.

    Answer

    loop

  5. 5
    In the context of problem solving, a
    _____
    is a more precise and unambiguous way to express an algorithm compared to natural language.
    Hint

    It uses keywords and structured statements.

    Answer

    pseudocode

  6. 6
    When writing pseudocode, the convention is that list indexing starts from
    _____
    .
    Hint

    In the course, they used this convention for pseudocode, different from Python.

    Answer

    1

  7. 7
    In Python, a variable's type is determined automatically based on the value assigned; this feature is called
    _____
    typing.
    Hint

    You don't need to declare the type beforehand.

    Answer

    dynamic

  8. 8
    The assignment operator in Python is the
    _____
    symbol.
    Hint

    It is used to store a value in a variable.

    Answer

    =

  9. 9
    The data type of the value 3.14 is
    _____
    .
    Hint

    It contains a decimal point.

    Answer

    float

  10. 10
    A complex number in Python is written as 2 + 3j. The imaginary part is denoted by the letter
    _____
    .
    Hint

    It is used instead of 'i' common in mathematics.

    Answer

    j

  11. 11
    The arithmetic operator that returns the integer quotient of a division is
    _____
    .
    Hint

    It performs floor division.

    Answer

    //

  12. 12
    The Boolean data type can have two values:
    _____
    and False.
    Hint

    It is the opposite of false.

    Answer

    True

  13. 13
    The operator that checks if two values are not equal is
    _____
    .
    Hint

    It is composed of an exclamation mark and an equals sign.

    Answer

    !=

  14. 14
    The logical operator that returns True only when both operands are True is
    _____
    .
    Hint

    It behaves like conjunction.

    Answer

    and

  15. 15
    In Python, a variable name cannot start with a
    _____
    .
    Hint

    Think of the rules for identifiers.

    Answer

    digit

  16. 16
    The keyword used to define a function in Python is
    _____
    .
    Hint

    It is short for 'define'.

    Answer

    def

  17. 17
    A
    _____
    is a string literal used as the first statement in a function to describe its purpose.
    Hint

    It is enclosed in triple quotes.

    Answer

    docstring

  18. 18
    The
    _____
    statement is used to exit a function and optionally return a value.
    Hint

    It sends a value back to the caller.

    Answer

    return

  19. 19
    Variables defined inside a function have
    _____
    scope and are not accessible outside the function.
    Hint

    They exist only during function execution.

    Answer

    local

  20. 20
    To accept an arbitrary number of positional arguments in a function, you use
    _____
    *args.
    Hint

    It is a single asterisk before the parameter name.

    Answer
  21. 21
    When defining a function, a parameter with a
    _____
    value is optional at call time.
    Hint

    It is specified using an equals sign in the function definition.

    Answer

    default

  22. 22
    A Python file containing functions that can be imported into other scripts is called a
    _____
    .
    Hint

    It has a .py extension.

    Answer

    module

  23. 23
    The string method that removes whitespace from the beginning and end of a string is
    _____
    .
    Hint

    It also removes leading and trailing spaces.

    Answer

    strip

  24. 24
    Strings in Python are
    _____
    , meaning their elements cannot be changed after creation.
    Hint

    It is the opposite of mutable.

    Answer

    immutable

  25. 25
    The expression "Hello" + " " + "World" results in the string
    _____
    .
    Hint

    The plus operator concatenates strings.

    Answer

    "Hello World"

  26. 26
    The slicing operation s[2:5] on a string returns characters from index 2 up to, but not including, index
    _____
    .
    Hint

    The end index is exclusive.

    Answer

    5

  27. 27
    To check if a substring is present in a string, you can use the
    _____
    keyword.
    Hint

    It returns a Boolean.

    Answer

    in

  28. 28
    A list is a
    _____
    data structure, meaning its elements can be changed after creation.
    Hint

    It is the opposite of immutable.

    Answer

    mutable

  29. 29
    A tuple is defined using
    _____
    parentheses.
    Hint

    These are round brackets.

    Answer

    ()

  30. 30
    A set is an unordered collection that does not allow
    _____
    elements.
    Hint

    Each element appears only once.

    Answer

    duplicate

  31. 31
    In a dictionary, each item consists of a key and a
    _____
    .
    Hint

    It is the second part of the pair.

    Answer

    value

  32. 32
    The list method that adds an element to the end of the list is
    _____
    .
    Hint

    It takes one argument.

    Answer

    append

  33. 33
    To remove and return the last element of a list, you use the
    _____
    method.
    Hint

    It can also accept an index.

    Answer

    pop

  34. 34
    Assigning one list variable to another does not create a copy; instead, it creates a
    _____
    to the same list object.
    Hint

    Both variables point to the same memory location.

    Answer

    reference

  35. 35
    To create a true independent copy of a list, you can use the
    _____
    method.
    Hint

    It is called on the list object.

    Answer

    copy

  36. 36
    In NumPy, the property that returns the number of dimensions of an array is
    _____
    .
    Hint

    It is short for 'number of dimensions'.

    Answer

    ndim

  37. 37
    The NumPy function that creates an array of evenly spaced numbers within a range is
    _____
    .
    Hint

    It returns a specified number of samples.

    Answer

    linspace

  38. 38
    The attribute that returns a tuple of array dimensions is
    _____
    .
    Hint

    It gives the size of each dimension.

    Answer

    shape

  39. 39
    In NumPy, slices of arrays return a
    _____
    of the original data, not a copy.
    Hint

    Changes to the slice affect the original array.

    Answer

    view

  40. 40
    The operation of adding a scalar to an array, where the scalar is automatically 'spread' across the array, is called
    _____
    .
    Hint

    It allows operations on arrays of different shapes.

    Answer

    broadcasting

  41. 41
    A function that operates element-wise on a NumPy array and is implemented in compiled C for speed is called a
    _____
    function.
    Hint

    Often abbreviated as ufunc.

    Answer

    universal

  42. 42
    The NumPy function that returns the indices of elements that satisfy a condition is
    _____
    .
    Hint

    It can be used to find locations of specific values.

    Answer

    argwhere

  43. 43
    In pandas, a one-dimensional labeled array is called a
    _____
    .
    Hint

    It is similar to a column in a spreadsheet.

    Answer

    Series

  44. 44
    A two-dimensional tabular data structure with labeled axes in pandas is called a
    _____
    .
    Hint

    It is similar to a table or Excel sheet.

    Answer

    DataFrame

  45. 45
    To read a CSV file into a DataFrame, you use the pandas function
    _____
    .
    Hint

    It is called on the pandas module.

    Answer

    read_csv

  46. 46
    The pandas method that fills missing values in a DataFrame is
    _____
    .
    Hint

    It stands for 'fill NA'.

    Answer

    fillna

  47. 47
    The pandas method that removes rows with missing values is
    _____
    .
    Hint

    It drops NA entries.

    Answer

    dropna

  48. 48
    The pandas method used to split data into groups based on some criteria is
    _____
    .
    Hint

    It is followed by an aggregation function.

    Answer

    groupby

  49. 49
    The function from matplotlib.pyplot that creates a line plot is
    _____
    .
    Hint

    It is called on the pyplot module.

    Answer

    plot

  50. 50
    To create a scatter plot in matplotlib, you use the function
    _____
    .
    Hint

    It displays individual points without connecting lines.

    Answer

    scatter

  51. 51
    The command to display a plot in matplotlib is
    _____
    .
    Hint

    It is called at the end of plotting commands.

    Answer

    show

  52. 52
    In matplotlib, to add a legend to a plot, you call the
    _____
    method.
    Hint

    It is called on the pyplot object.

    Answer

    legend

1 of 52
Question 1 of 52

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent