Chapter 1 : ZyBooks Python Vocab

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

1/49

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.

50 Terms

1
New cards

program

A computer program consists of instructions executing one at a time.

2
New cards

Input

Input: A program receives data from a file, keyboard, touchscreen, network, etc.

3
New cards

Process

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

4
New cards

Output

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

5
New cards

variables

Programs use variables to refer to data, like x.

6
New cards

computational thinking

In the information age, many people believe computational thinking, or creating a sequence of instructions to solve a problem, will become increasingly important for work and everyday life.

7
New cards

algorithm

A sequence of instructions that solves a problem is called an algorithm.

8
New cards

Python interpreter

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

9
New cards

interactive interpreter

An interactive interpreter is a program that allows the user to execute one line of code at a time.

10
New cards

Code

Code is a common word for the textual representation of a program (and hence programming is also called coding).

11
New cards

line

A line is a row of text.

12
New cards

prompt

The interactive interpreter displays a prompt (">>>") that indicates the interpreter is ready to accept code.

13
New cards

statement

A statement is a program instruction.

14
New cards

Expressions

Expressions are code that return a value when evaluated; for example, the code wage hours weeks is an expression that computes a number.

15
New cards

variables

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

16
New cards

assignment

A new variable is created by performing an assignment using the = symbol.

17
New cards

print()

Print() function displays variables or expression values.

18
New cards

comments

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

19
New cards

print()

The primary way to print output is to use the built-in function print().

20
New cards

string literal

Text enclosed in quotes is known as a string literal.

21
New cards

newline

A line break, known as a newline, is output after every print() statement.

22
New cards

newline character

Output can be moved to the next line by printing "\n", known as a newline character.

23
New cards

whitespace

Any space, tab, or newline is called whitespace.

24
New cards

input()

Reading input is achieved using the input() function.

25
New cards

string

The input obtained by input() is any text that a user typed, including numbers, letters, or special characters such as # or @. Such text in a computer program is called a string.

26
New cards

type

Strings and integers are each an example of a type; a type determines how a value can behave.

27
New cards

int()

If a string contains only numbers, like '123', then the int() function can be used to convert that string to the integer 123.

28
New cards

whitespace

Whitespace is any blank space or newline.

29
New cards

variable

In a program, a variable is a named item, such as x or num_people, that holds a value.

30
New cards

assignment statement

An assignment statement assigns a variable with a value, such as x = 5.

31
New cards

incrementing

Increasing a variable's value by 1, as in x = x + 1, is common and known as incrementing the variable.

32
New cards

identifier / name / underscores

An identifier, also called a name, is a sequence of letters (a-z, A-Z), underscores (_), and digits (0-9), and must start with a letter or an underscore.

33
New cards

case sensitive

Python is case sensitive, meaning uppercase and lowercase letters differ. Ex: "Cat" and "cat" are different.

34
New cards

Reserved words / keywords

Reserved words, or keywords, are words that are part of the language and cannot be used as a programmer-defined name.

35
New cards

PEP 8

PEP 8 (Python Enhancement Proposal) outlines the basics of how to write Python code neatly and consistently.

36
New cards

object

An object represents a value and is automatically created by the interpreter when executing a line of code. For example, executing x = 4 creates a new object to represent the value 4.

37
New cards

garbage collection

Deleting unused objects is an automatic process called garbage collection that frees memory space.

38
New cards

Name binding

Name binding is the process of associating names with interpreter objects. An object can have more than one name bound to it, and every name is always bound to exactly one object. Name binding occurs whenever an assignment statement is executed, as demonstrated below.

39
New cards

Value

Value: A value such as "20", "abcdef", or "55".

40
New cards

Type

Type: The type of the object, such as integer or string.

41
New cards

Identity

Identity: A unique identifier that describes the object.

42
New cards

type()

The built-in function type() returns the type of an object.

43
New cards

Mutability

Mutability indicates whether the object's value is allowed to be changed.

44
New cards

immutable

Integers and strings are immutable; meaning integer and string values cannot be changed.

45
New cards

id()

Python provides a built-in function id() that gives the value of an object's identity.

46
New cards

syntax error

One kind of mistake, a syntax error, violates a programming language's rules on how symbols can be combined to create a program.

47
New cards

runtime error

The program may have another kind of error called a runtime error, in which a program's syntax is correct but the program attempts an impossible operation, such as dividing by zero or multiplying strings together (like 'Hello' * 'ABC').

48
New cards

crash

Abrupt and unintended termination of a program is often called a crash of the program.

49
New cards

logic error

Such an error is known as a logic error, because the program is logically flawed.

50
New cards

bug

A logic error is often called a bug.