D335: Introduction to Python (Sections 1-4) with complete verified solutions 2025

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/153

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.

154 Terms

1
New cards

Input

A program gets data, perhaps from a file, keyboard, touchscreen, network, etc.

2
New cards

Process

A program performs computations on that data, such as adding two values like x + y

3
New cards

Output

A program puts that data somewhere, such as to a file, screen, or network.

4
New cards

computational thinking,

creating a sequence of instructions to solve a problem

5
New cards

algorithm

A sequence of instructions that solves a problem

6
New cards

Python interpreter

a computer program that executes code written in the Python programming language.

7
New cards

interactive interpreter

a program that allows the user to execute one line of code at a time

8
New cards

Code

a common word for the textual representation of a program

9
New cards

line

row of text

10
New cards

prompt

indicates the interpreter is ready to accept code

11
New cards

statement

a program instruction

12
New cards

Expressions

code that return a value when evaluated

13
New cards

cariables

named references to values stored by the interpreter

14
New cards

print()

function that displays variables or expression values

15
New cards

'#"

character tha denote comments, which are optional but can be used to explains portions of code to a human reader

16
New cards

string literal

text enclosed in quotes (single or double) and can contain letters, numbers, spaces, or symbols

17
New cards

Why would a programmer add

end=' ' inside of print()?

To keep the output on the same line

18
New cards

print(variable_name) without quotes

to output the value of a variable

19
New cards

\n

newline character; output can be moved to the next line

20
New cards

whitespace

any space, tab, or newline

21
New cards

variable = input()

reads a user-enter string and changes it into a variable

22
New cards

type

determines how a value can behave

23
New cards

int()

converts a string to an integer

24
New cards

syntax error

violating a programming language's rules on how symbols can be combined to create a program

25
New cards

runtime error

program's syntax is correct, but the program attemps an impossible operation, such as dividing by zero or multiplying strings together

26
New cards

crash

Abrupt and unintended termination of a program

27
New cards

SyntaxError

The program contains invalid code that cannot be understood.

28
New cards

IndentationError

The lines of the program are not properly indented.

29
New cards

ValueError

An invalid value is used- can occur if giving letter to int().

30
New cards

NameError

The program tries to use a variable that does not exist.

31
New cards

TypeError

An operation uses incorrect types - can occur if adding an integer to a string

32
New cards

logic error

An error in a program that makes it do something other than what the programmer intended. (would still load correctly)

33
New cards

A logic error is often called a ______.

bug

34
New cards

integrated development environment (IDE)

Provides a developer with a way to create a program, run the program, and debug the program all within one application.

35
New cards

switch

controls whether or not electricity flows through a wire

36
New cards

Positive voltage is treated as a what in computers?

1

37
New cards

Zero voltage is treated as a what in computers?

0

38
New cards

0s and 1s in are known as what in computers

bits (binary digits)

39
New cards

processors

created to process a list of desired calculations

40
New cards

instruction

a calculation completed by a processor

41
New cards

memory

circuit that can stors 0s and 1s in each of a series of thousands of addressed locations

42
New cards

A ______ computes data.

processor

43
New cards

_________ stores data.

Memory

44
New cards

The programmer-created sequence of instructions is call a _______________ or just an app.

program application

45
New cards

machine instructions

instructions represented as 0s and 1s

46
New cards

excutable program

a sequence of machine instructions together

47
New cards

assembly

language that translate machine instructions into human readable instructions

48
New cards

high-level languages

programming using formulas or algorithms

49
New cards

scripting language

a language tht allows program to be executed withoout compilation

50
New cards

script

a program whose instructions are executed by another program called an interpreter

51
New cards

backward compatible

software feature that enables documents saved in an older version of a program to be opened in a newer version of the program

52
New cards

variable

named item used to hold a value

53
New cards

assignment statement

assigns a variable with a value

54
New cards

identifier (also called a name)

a sequence of letters, underscores, and digits. It must also start with a letter or an underscore

55
New cards

object

represents a value and is automatically created by the interpreter when executing aline of code

56
New cards

garbage collection

Deleting unused objects is an automatic process

57
New cards

Name binding

the process of associating names with interpreter objects

58
New cards

module

a file containing Python code that can be used by other modules or scripts

59
New cards

import

the statement used to make a module availble for use

60
New cards

dot notation

The syntax for calling a function in another module by specifying the module name followed by a dot (period) and the function name.

61
New cards

What is one way you know that a file was executed as a script in Python?

If the value of _name_ is the string '_main_'

62
New cards

function

list of statements that can be executed simply by referring to the function's name

63
New cards

function call

process of invoking a function

64
New cards

argument

item passed to a function

65
New cards

ceil(x)

round up value

66
New cards

factorial(x)

factorial (3! = 3 2 1)

67
New cards

fmod(x, y)

remainder division

68
New cards

fabs(x)

absolute value of x

69
New cards

floor(x)

Round down value

70
New cards

fsum(x)

Floating-point sum of a range, list, or array.

71
New cards

exp(x)

exponential function e^x

72
New cards

pow(x, y)

raise x to power y

73
New cards

log(x, (base))

Natural logarithm; base is optional

74
New cards

sqrt(x)

square root of x

75
New cards

acos(x)

Arc cosine

76
New cards

asin(x)

Arc sine

77
New cards

atan(x)

Arc tangent

78
New cards

atan2(y, x)

Arc tangent with two parameters

79
New cards

cos(x)

cosine

80
New cards

sin(x)

sine

81
New cards

hypot(x1, x2, x3, ..., xn)

Length of vector from origin

82
New cards

degrees(x)

Convert from radians to degrees

83
New cards

radians(x)

convert degrees to radians

84
New cards

tan(x)

tangent

85
New cards

cosh(x)

hyperbolic cosine

86
New cards

sinh(x)

hyperbolic sine

87
New cards

gamma(x)

Gamma function

88
New cards

erf(x)

error function

89
New cards

pi (constant)

Mathematical constant 3.141592...

90
New cards

e (constant)

Mathematical constant 2.718281...

91
New cards

unicode

represent every possible character as a unique number (code point)

92
New cards

\\

Backslash (\)

93
New cards

\'

Single-quote (')

94
New cards

\"

Double-quote (")

95
New cards

\t

tab (indent)

96
New cards

ord()

returns an encoded integer value for a string of length one.

97
New cards

chr()

returns a string of one character for an encoded integer

98
New cards

container

a construct used to group related values together and contains references to other objects intead of data

99
New cards

list

a container created by surrounding a sequence of vaiable or literals with brackets [ ]

100
New cards

element

list item