Python Module Reviewer

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/63

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

64 Terms

1
New cards
Python
A popular programming language known for its ease of use, readability, completeness, cross-platform compatibility, and open-source nature, suitable for various applications like data science and web development.
2
New cards
Anaconda Distribution
A recommended Python distribution that simplifies installation and comes with pre-installed packages and tools like Jupyter.
3
New cards
Jupyter
A browser-based application providing an environment for running and testing Python codes, ideal for documentation, sharing, and code replicability.
4
New cards
Jupyter Notebook Server
The command-line interface that enables users to access Jupyter Notebook on their localhost.
5
New cards
Jupyter Dashboard
A web browser-accessible interface (URL: localhost:8888) connected to the Jupyter Notebook Server, displaying files and folders in the home directory and allowing the creation of new Python notebooks.
6
New cards
Cell (in Jupyter)
A block in a Jupyter notebook where code or text is written, enclosed in a box, with types including code cells (for Python code) and markdown cells (for formatted text).
7
New cards
Markdown Cell
A type of cell in Jupyter that allows the creation of formatted text using elements like headers (#, ##), bold text (using **), etc.
8
New cards
Edit Mode (in Jupyter)
A Jupyter mode, indicated by a green line on the left of an active cell, where users can type codes or markdown text.
9
New cards
Command Mode (in Jupyter)
A Jupyter mode, indicated by a blue line on the left of an active cell, used for notebook-level actions.
10
New cards
Execution Number (in Jupyter)
A number assigned by Jupyter to track the order in which code cells are executed, displayed on the right side of executed cells.
11
New cards
print() in Python
A function that outputs whatever is inside the open and close parentheses, treating characters enclosed in quotations as a string.
12
New cards
Numerical Operations in Python
Basic operations including addition (+), subtraction (-), multiplication (), division (/), exponentiation (*), modulo (%), and integer division (//).
13
New cards
Module (in Python)
An external Python file that can be imported to a current Python file, containing functions and other resources.
14
New cards
Logical Operators in Python
Keywords such as 'and', 'or', and 'not' used for multiple comparisons and negation of comparison results.
15
New cards
Variable (in Python)
A named value that can be assigned a value using the assignment operator (=), used to remember and reuse values and past calculations.
16
New cards
%whos (in Jupyter)
A magic command that allows users to see all the variables in the current notebook.
17
New cards
Data Types (in Python)
Classes specifying the type of data that can be stored inside a variable, including numeric (int, float, complex), string (str), sequence (list, tuple, range), mapping (dict), boolean (bool), and set (set, frozenset).
18
New cards
type() (in Python)
A command used to determine the type of data stored in a variable.
19
New cards
input() in Python
Takes user input
20
New cards
int() in Python
Converts a value to integer type
21
New cards
float() in Python
Converts a value to floating point type
22
New cards
round() in Python
Rounds a value to a specified precision
23
New cards

Branching statements

Are code constructs that execute a block of code depending on a set of conditional criteria.

24
New cards

logical expressions

For branching statements, these criteria are written as ___________, and when satisfied, they execute a corresponding set of instructions.

25
New cards

Control flow

These refer to the order of execution of computer instructions

26
New cards

if statement

signifies an evaluation of its input logical expression. The code block will be executed only if the expression evaluates to a True value.

27
New cards

If-Else statement

A variant of the If statement. In this variant, a separate else code block is executed if the input logical expression of the if statement evaluates to False.

28
New cards

if-elif-else statement

This statement is another extension of the if statement. It can provide a second if condition that will be evaluated if the first if condition evaluates to false.

29
New cards

Three main ways to perform sequence of instructions over each item.

  • for loop

  • while loop

  • list comprehension

30
New cards

for loop

This loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

31
New cards

while loop

This loop can execute a set of statements as long as a condition is true.

32
New cards

Terminating an infinite loop

Manually by pressing the black square button in the menu, indicating ‘kernel interruption.’

33
New cards

List Comprehension

A construct short, and elegant way of creating a list based on existing lists.

34
New cards

Strings

Represents plan text. Should be enclosed in either ingle or double qoutations.

35
New cards

len()

Returns the length of an object.

36
New cards

Strings:Index

Indicates the location of the individual characters in a string.

37
New cards

Strings: Slicing

Accessing a part of the string through index enclosed in square brackets.

38
New cards

Strings: Concatenation

This is indicated by the symbol + performed on strings. Does not perform with a string and an integer.

39
New cards

str()

A built-in function that converts non-string to string.

40
New cards

help()

A built in function to have an idea of how a certain method works.

41
New cards

Lists

It is a sequence of values. The values are called its elements or items. It is defined by enclosing its items in square brackets, separated by commas, and can hold any type of data.

42
New cards

append()

A list method that adds an item at the end of the list.

43
New cards

insert()

A list method that inserts an item at a given index.

44
New cards

remove()

A list method that removes the first occurrence of a string.

45
New cards

list(“[string] ”)

Syntax for converting a string into a list.

46
New cards

Tuple

An immutable sequence type in Python that can hold a collection of items. Uses a pair of parentheses(), elements are separated by commas.

Operations like getting the length, indexing, slicing, using + and in are the same as those in strings and lists.

47
New cards

Homogeneous

A collection with same type. Lists are usually considered this type of collection.

48
New cards

Heterogeneous

Collection with different types. Tuples are usually considered this type of collection.

49
New cards

Dictionary

  • A general version of a list.

  • Are indexed by keys

  • Compromises of key-value pairs, and each key maps to a comma separated key:value pairs.

  • Declared by key:value pars enclosed in square brackets.

50
New cards

keys()

A dictionary method to get all the keys in a dictionary.

51
New cards

values()

A dictionary method to get all the values in a dictionary.

52
New cards

items()

A dictionary method to get all the key-value pairs in a dictionary.

53
New cards

in operator

An operator when used on dictionaries search occurrence from the keys.

54
New cards

list() on a dictionary

Access a list of dictionary keys.

55
New cards

Functions

A sequence of instructions that performs a task.

56
New cards

def()

used to make new function will be defined.

57
New cards

Components of a user-defined function

  • Function Header

  • Function Body

  • Descriptive String

58
New cards

Function Header

  • Starts with a keyword def

  • Followed by a function name

  • Followed by a pair of parenthesis with the input parameter inside and ends with a colon ( : )

59
New cards

Parameters

Are variables that the user need to supply to a function as input and can be manipulated in the body of the function.

60
New cards

Function Body

  • Where the step-by-step instructions to be executed upon calling the function was placed.

  • It is important to note that the instructions in the body function must be indented, and in the case of multiple instructions, all the instructions must be of the same indent.

  • At the end of function body, it can return some output.

61
New cards

Descriptive String

  • After defining the function header, an optional descriptive string can be placed in the middle of triple single or triple double qoutes.

  • This can be used to describe in more detail the task that will be performed by the function.

  • The descriptive string is also accessed by the command help().

62
New cards

Local Variables

Variables that are local to the function and is not part of the variables tracked across the whole Python notebook.

63
New cards
64
New cards