COSC 145: Python Fundamentals and Applied Logic

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

1/16

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering core Python functions, comparison operators, conversion formulas, and logic rules from COSC 145 quizzes and midterm materials.

17 Terms

1
New cards

sorted()

A built-in Python function that returns a new, sorted copy of an iterable (such as a list or string) without altering the original data structure.

2
New cards

["abracadabra"] vs. "abracadabra"

["abracadabra"]["abracadabra"] is a Python list containing a single string element of length 11, whereas "abracadabra""abracadabra" is a string literal containing a sequence of 1111 characters.

3
New cards

min()

A built-in Python function that evaluates an iterable or multiple arguments and returns the element with the lowest value.

4
New cards

sum()

A built-in Python function that takes an iterable of numeric values and returns their total sum as a single number.

5
New cards

Floor Division (//)

An arithmetic operator that divides two numbers and rounds the result down to the nearest integer, discarding any fractional remainder.

6
New cards

Centimeter to Inch Conversion Factor

The exact metric-to-imperial conversion ratio stating that 1 inch=2.54 centimeters1\,\text{inch} = 2.54\,\text{centimeters}, meaning centimeters divided by 2.542.54 yields inches.

7
New cards

Double Equals Sign (==)

The comparison operator in Python used to evaluate whether two expressions or values are equal, distinct from the single equals sign (==, which performs assignment).

8
New cards

Colon (:) in Python Control Flow

A mandatory syntactic character required at the end of header statements such as if, elif, else, for, and while to introduce an indented block of code.

9
New cards

Method

A specialized function that belongs to and is called on a specific object or class using dot notation (e.g., s.title()).

10
New cards

Function

A reusable, standalone block of code that is invoked by its identifier directly and passed arguments to perform a task (e.g., sorted(), min()).

11
New cards

Body Mass Index (BMI) Formula

A metric calculation defined as weight in kilograms divided by height in meters squared: BMI=weightheight2\text{BMI} = \frac{\text{weight}}{\text{height}^2}.

12
New cards

BMI Optimum Range

A Body Mass Index value between 18.518.5 and 24.924.9 inclusive; values below 18.518.5 are classified as underweight, and values above 24.924.9 are classified as overweight.

13
New cards

Shortbread Recipe Base Ratio

An ingredient ratio specifying 2.52.5 cups of flour, 11 cup of butter, and 0.50.5 cup of sugar per batch of 1212 cookies.

14
New cards

Fahrenheit to Celsius Conversion Formula

The temperature conversion relationship defined as ∘C=∘F−329/5^\circ\text{C} = \frac{^\circ\text{F} - 32}{9/5}.

15
New cards

Office Comfort Range

An acceptable temperature range defined as between 18∘C18^\circ\text{C} and 23∘C23^\circ\text{C}; below 18∘C18^\circ\text{C} is classified as "Too cold" and above 23∘C23^\circ\text{C} is classified as "Too hot".

16
New cards

Demographic Percentage Formula

The proportion of a specific subgroup relative to the total workforce, calculated as percentage=subgroup_counttotal×100.0\text{percentage} = \frac{\text{subgroup\_count}}{\text{total}} \times 100.0.

17
New cards

Divisibility Test

A conditional test using the modulo operator to determine whether an integer divides evenly with zero remainder (e.g., n % 5 == 0 for divisibility by 55).