Zybook : Introduction to Python \ 1064 with complete verified solutions 2025 (GUARANTEED PASS)

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/58

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.

59 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

algorithm

A sequence of instructions that solves a problem

5
New cards

interactive interpreter

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

6
New cards

Code

common word for the textual representation of a program

7
New cards

line

a row of text

8
New cards

prompt

What the interactive interpreter displays that indicates the interpreter is ready to accept code

9
New cards

statement

a program instruction. (A program mostly consists of a series of statements, and each statement usually appears on its own line)

10
New cards

Expressions

are code that return a value when evaluated;

for example, the code wage hours weeks is an expression that computes a number.

The symbol * is used for multiplication.

The names wage, hours, weeks, and salary are variables, which are named references to values stored by the interpreter.

11
New cards

print()

) function displays variables or expression values

12
New cards

comments

# denote comments, which are optional but can be used to explain portions of code to a human reader.

13
New cards

variables

store values for later use

14
New cards

string literal

Text enclosed in quotes

Ex:print('hello world')

15
New cards

end=' '

Each call to print() outputs on a new line. However, sometimes a programmer may want to keep output on the same line. A programmer can add end=' ' inside of print() to keep the output of a subsequent print statement on the same line separated by a single space. Ex: print('Hello', end=' ').

16
New cards

Value of variable

The value of a variable can be printed out without quotes

Ex:print(variable_name)

17
New cards

newline character

Output can be moved to the next line by printing "\n"

Ex: print('1\n2\n3') prints "1" on the first line, "2" on the second line, and "3" on the third line of output.

18
New cards

whitespace

Any space, tab, or newline

19
New cards

input()

Reading input is achieved using the input() function. The statement best_friend = input() will read text entered by the user and the best_friend variable is assigned with the entered text. The function input() causes the interpreter to wait until the user has entered some text and has pushed the return key.

20
New cards

string

represents a sequence of characters.

For example, the string 'Hello' consists of the characters 'H', 'e', 'l', 'l', and 'o'.

21
New cards

type

srings and integers are each an exampleof a type. a type determines how a value can behave.

ex: integers can be divided by 2, but not strings (what sense would "Hello" / 2 make?)

22
New cards

int()

used to indicate an integer

23
New cards

A programmer can combine input() and int() to read in a string from the user and then convert that string to an integer for use in a calculation.

Example: num1 = int(input()) num2 = int(input()) print(num1 + num2)

24
New cards

syntax error

is to violate a programming language's rules on how symbols can be combined to create a program.

An example is putting multiple prints on the same line.

25
New cards

runtime error

a program's syntax is correct but the program attempts an impossible operation

Ex: dividing by zero or multiplying strings together (like 'Hello' * 'ABC').

A runtime error halts the execution of the program

26
New cards

crash

Abrupt and unintended termination of a program

27
New cards

IndentationError

The lines of the program are not properly indented.

28
New cards

ValueError

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

29
New cards

NameError

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

30
New cards

TypeError

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

31
New cards

logic error

Some errors may be subtle enough to silently misbehave, instead of causing a runtime error and a crash,called logic error because the program is logically flawed

32
New cards

bug

a logic error

33
New cards

integrated development environment, or IDE

what Code development is usually done with

34
New cards

Switches

controls whether or not electricity flows through a wire

An electronically controlled switch, a positive voltage at the control input allows electricity to flow, while a zero voltage prevents the flow.

Such switches were useful, for example, in routing telephone calls.

Engineers soon realized they could use electronically controlled switches to perform simple calculations.

The engineers treated a positive voltage as a "1" and a zero voltage as a "0". 0s and 1s are known as bits (binary digits).

They built connections of switches, known as circuits, to perform calculations such as multiplying two numbers.

35
New cards

bits (binary digits)

The engineers treated a positive voltage as a "1" and a zero voltage as a "0". 0s and 1s are known as bits

36
New cards

circuits

They built connections of switches, known as circuits, to perform calculations such as multiplying two numbers.

37
New cards

processors

circuits called processors were created to process (aka execute) a list of desired calculations, each calculation called an instruction

38
New cards

memory

is a circuit that can store 0s and 1s in each of a series of thousands of addressed locations, like a series of addressed mailboxes that each can store an envelope (the 0s and 1s). Instructions operate on data, which is also stored in memory locations as 0s and 1s.

39
New cards

program, application, or just app

programmer-created sequence of instructions

40
New cards

machine instructions

Instructions represented as 0s and 1s

41
New cards

executable program

a sequence of machine instructions together

42
New cards

assemblers / (assembly language)

0s and 1s are hard to comprehend, programmers soon created programs called assemblers to automatically translate human readable instructions, such as "Mul 97, #9, 98", known as assembly language instructions, into machine instructions. The assembler program thus helped programmers write more complex programs.

43
New cards

high-level languages

in the 1960s and 1970s, programmers created high-level languages to support programming using formulas or algorithms, so a programmer could write a formula like F = (9 /5 ) * C + 32. Early high-level languages included FORTRAN (for "Formula Translator") or ALGOL (for "Algorithmic Language"), which were more closely related to how humans thought than were machine or assembly instructions.

44
New cards

compilers

are programs that automatically translate high-level language programs into executable programs

45
New cards

Input/output devices: A screen and keyboard

screen (or monitor) displays items to a user

the keyboard allows a user to provide input to the computer, typically accompanied by a mouse for graphical displays.

46
New cards

disk

stores files and other data

Disks are non-volatile, meaning they maintain their contents even when powered off. They do so by orienting magnetic particles in a 0 or 1 position.

47
New cards

RAM(random-access memory)

temporarily holds data read from storage and is designed such that any address can be accessed much faster than disk, in just a few clock ticks (see below) rather than hundreds of ticks. The "random access" term comes from being able to access any memory location quickly and in arbitrary order, without having to spin a disk to get a proper location under a head. RAM is volatile, losing its contents when powered off

48
New cards

byte

a byte is 8 bits (Memory size is typically listed in bits, or in bytes where )

49
New cards

Processor

runs the computer's programs, reading and executing instructions from memory, performing operations, and reading/writing data from/to memory.

50
New cards

BIOS (basic input/output system)

When powered on, the processor starts executing the program whose first instruction is (typically) at memory location 0.

It sets up the computer's basic peripherals.

51
New cards

OS). operating system

allows a user to run other programs and interfaces with the many other peripherals. Processors are also called CPUs (central processing unit) or microprocessors

52
New cards

cache

Because speed is so important, a processor may contain a small amount of RAM on its own chip, called cache memory, accessible in one clock tick rather than several, for maintaining a copy of the most-used instructions/data.

53
New cards

clock

A processor's instructions execute at a rate governed by the processor's clock, which ticks at a specific frequency.

Examples of clock tik rates : 1 MHz (1 million ticks/second) for an inexpensive processor ($1) like those found in a microwave oven or washing machine, to 1 GHz (1 billion ticks/second) for costlier ($10-$100) processors like those found in mobile phones and desktop computers.

54
New cards

transistors

smaller switches

55
New cards

integrated circuit or IC

a single chip which is the computer

56
New cards

Moore's Law

The doubling of IC capacity roughly every 18 months,

57
New cards

scripting languages

programmers began creating scripting languages to execute programs without the need for compilation.

58
New cards

script

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

59
New cards

open-source language

meaning the community of users participate in defining the language and creating new interpreters, and is supported by a large community of programmers