D335 Introduction to Programming in Python

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/11

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.

12 Terms

1
New cards

Input

A program receives data 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 a file, screen, or network.

4
New cards

Algorithm

A sequence of instructions that solves a problem.

5
New cards

Python Interpreter

The Python interpreter is a computer program that executes code written in the Python programming language. An interactive interpreter is a program that allows the user to execute one line of code at a time.

6
New cards

Statement

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

7
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.

8
New cards

Assignment

A new variable is created by performing an assignment using the = symbol, such as salary = wage hours weeks, which creates a new variable called salary.

9
New cards

Newline Character

Output can be moved to the next line using the newline character "\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.

10
New cards

Escape sequence

An escape sequence is a string that has a special meaning, like the newline character "\n", that always starts with a backslash "\". Other escape sequences exist, such as "\t" to insert a tab, or "\\" to print an actual backslash character.

11
New cards

input() function

The input() function is used to read input from a user. The statement best_friend = input() will read text entered by the user, and assign the result as a new string to the best_friend variable. The input() function causes the program to wait until the user has entered text and pushed the return key.

12
New cards

type

The string '123' (with quotes) is fundamentally different from the integer 123 (without quotes). The '123' string is a sequence of the characters '1', '2', and '3' arranged in a certain order, whereas 123 represents the integer value one-hundred twenty-three. Strings and integers are each an example of a type; a type determines how a value can behave. For example, integers can be divided by 2, but not strings (what sense would "Hello" / 2 make?). Types are discussed in detail later on