Introduction to Python Programming (MEK1300)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/58

flashcard set

Earn XP

Description and Tags

Vocabulary practice flashcards covering fundamental Python concepts across all eight lectures: computer architecture basics, variables, expressions, conditional execution, loops, functions, lists, tuples, sets, dictionaries, file I/O, and exception handling.

59 Terms

1
New cards

Computer

A machine that stores data, interacts with peripheral devices, and executes programs.

2
New cards

Hardware

The physical computer and all of its connected peripheral devices collectively.

3
New cards

Software

The programs and sequences of instructions that a computer executes.

4
New cards

Central Processing Unit (CPU)

The component of a computer that performs program control and data processing by locating and executing instructions.

5
New cards

Primary Storage

Electronic circuits made from memory chips that store data provided that they are supplied with electric power.

6
New cards

Secondary Storage

Slower and less expensive storage, such as a hard disk, that persists data without electricity.

7
New cards

Compile-time Error

A violation of the programming language syntax and rules that is detected when the code is translated into executable form; also known as a syntax error.

8
New cards

Run-time Error

An error that occurs when a program successfully compiles and runs but produces unexpected results or crashes during execution.

9
New cards

Algorithm

A sequence of discrete, unambiguous steps selected to produce a desired output or result from given inputs.

10
New cards

Pseudocode

A representation of an algorithm using structured natural language phrases rather than strict programming language syntax.

11
New cards

Variable

A named storage location in a computer program that holds a value.

12
New cards

Primitive Data Type

A fundamental data type provided directly by the programming language itself, such as numbers and strings.

13
New cards

Compound Data Type

A data type that can hold multiple items or elements, potentially of different types, as a single entity (such as lists, tuples, sets, and dictionaries).

14
New cards

Constant

A variable whose value is intended not to be changed after its initial assignment, conventionally named in all capital letters.

15
New cards

Floor Division

An integer division operation denoted by the //// operator that computes the quotient and discards the fractional part, returning the largest integer less than or equal to the mathematical result.

16
New cards

Modulus Operator

An arithmetic operator denoted by % that calculates the remainder of division, obeying the relationship a%b=a−b×(a//b)a \% b = a - b \times (a // b).

17
New cards

String

A sequence of characters, written inside single or double quotation marks.

18
New cards

String Concatenation

The operation of combining two or more strings together end-to-end to form a single string using the ++ operator.

19
New cards

Escape Sequence

A sequence of characters beginning with a backslash (such as \n for a newline) that represents a special character rather than literal text.

20
New cards

Prompt

A message printed to the screen that informs the user what input is expected when the program requests data.

21
New cards

Conditional Execution

A fundamental programming construct in which certain instructions are executed only if a specified condition evaluates to true.

22
New cards

Relational Operator

An operator used to compare two values, such as numbers or strings (e.g., ==, !=, <, <=, >, >=).

23
New cards

Lexicographic Ordering

The sequential character-by-character ordering used to compare strings, in which uppercase letters precede lowercase letters and numeric characters precede letters.

24
New cards

Nested Branches

A conditional structure in which an if statement is placed inside the body or branch of another if statement.

25
New cards

Match-Case Statement

A structural pattern matching construct introduced in Python 3.103.10 that compares a subject value against multiple candidate patterns and executes the action of the first match.

26
New cards

Boolean Variable

A variable of type bool that can hold exactly one of two logical values: True or False.

27
New cards

De Morgan's Laws

Logical equivalence rules stating that not (A and B) is identical to not A or not B, and not (A or B) is identical to not A and not B.

28
New cards

Input Validation

The process of verifying that user-supplied values satisfy required program criteria and boundaries before using them in computations.

29
New cards

Loop

A control structure that repeats a block of instructions until a specific condition is no longer met or a collection of items is fully processed.

30
New cards

Hand-Tracing

A manual simulation of code execution where a programmer records and steps through variable values on paper to verify correctness or find errors.

31
New cards

Sentinel Value

A designated input value that signals the end of a sequence of data without being considered part of the processed dataset.

32
New cards

Infinite Loop

A loop whose terminating condition never evaluates to false, causing its body to execute repeatedly without ending on its own.

33
New cards

Break Statement

A statement that immediately halts execution of the innermost loop and skips all remaining statements in that loop body.

34
New cards

Continue Statement

A statement that ends the current iteration of a loop prematurely and jumps directly to the evaluation of the next iteration.

35
New cards

Nested Loops

A programming arrangement where one loop is placed entirely inside the body of another loop, commonly used for processing multi-dimensional data or tables.

36
New cards

Simulation

A computational model that uses a program and pseudo-random numbers to mimic real-world activities or theoretical behaviors over time.

37
New cards

Function

A named sequence of instructions that packages a computation into an understandable, self-contained, and reusable block.

38
New cards

Parameter Variables

Variables specified in a function header that are initialized with the corresponding arguments passed to the function when called; also called formal parameters.

39
New cards

Arguments

The actual values or expressions supplied to a function inside the parentheses of a function call; also called actual parameters.

40
New cards

Return Statement

A statement that terminates the execution of a function call and specifies the result passed back to the caller.

41
New cards

Scope of a Variable

The region of a program in which a particular variable is defined, visible, and accessible.

42
New cards

Global Variable

A variable defined outside of all functions that is accessible throughout the program and requires a global declaration to be modified inside a function.

43
New cards

List

A mutable container that stores an ordered collection of elements accessible by integer index positions.

44
New cards

Mutable

A property of a data structure that allows its contents or individual elements to be modified, added, or removed after creation.

45
New cards

List Reference

A value that specifies the memory location of a list; copying a list reference produces another pointer to the same list rather than an independent duplicate.

46
New cards

Linear Search

An algorithm that inspects elements sequentially from the start of a container to the end until a target match is found.

47
New cards

Tuple

An immutable sequence of arbitrary data elements created as a comma-separated sequence, usually enclosed in parentheses.

48
New cards

Set

An unordered, mutable container that stores a collection of unique values without duplicate elements.

49
New cards

Subset

A set relation where every element present in the first set is also a member of the second set.

50
New cards

Set Union

An operation on two sets that returns a new set containing all unique elements belonging to either or both original sets.

51
New cards

Set Intersection

An operation on two sets that returns a new set containing only the elements that are common to both sets.

52
New cards

Set Difference

An operation that returns a new set containing the elements that belong to the first set but do not appear in the second set.

53
New cards

Dictionary

A mutable container (or map) that stores key-value pairs where each unique key maps to an associated value.

54
New cards

File Object

An object returned by the open() function that provides the programmatic interface and methods to read from or write to a file.

55
New cards

With Statement

A compound statement used when opening files that guarantees the file is properly closed automatically when the execution block finishes.

56
New cards

Exception

A signal or error condition raised during program execution that alters the normal flow of control unless caught and handled.

57
New cards

Try Block

A block of code wrapped with the try keyword that is monitored for runtime exceptions during execution.

58
New cards

Except Block

A block of code associated with a try statement that specifies how to handle a particular type of raised exception.

59
New cards

Finally Block

A clause in exception handling containing clean-up instructions that always execute, regardless of whether an exception occurred or was handled.