Module 2

4.0(1)
studied byStudied by 5 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/32

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

33 Terms

1
New cards
What do comments start with
a #
2
New cards
Lines of code can be categorized into three categories. What are they?
Input, processing, and output
3
New cards
Input statements
used to get data and pass it onto the program for processing
4
New cards
Processing Statements
Implement logic that is used to process the input and turn it into useful information
5
New cards
Output statements
used to display information on the screen
6
New cards
Algorithm
list of well defined computer instructions that can be used to solve a problem
7
New cards
program/source code/ code
List of statements that implement an algorithm using a programming language like python
8
New cards
variables
hold data that we can reuse in our program by writing the same variable name
9
New cards
Assignment Operator
right of the = is executed first, and result is assigned to the variable on the left
10
New cards
print
built in function to output data on the console
11
New cards
Debugging
process of finding bugs in your programs and sorting them out
12
New cards
Syntax Errors
language mistakes done by a programmer while writing code
13
New cards
Logic Errors
Algorithm that is used in the program is wrong.
14
New cards
String vs. Numbers
Strings include quotations, numbers do not
15
New cards
Rules for naming variables

1. consist of upper, lower letters, underscore, and numbers only
2. can only start with a letter or an underscore
3. case sensitive
4. cannot be the same as python reserved keywords
16
New cards
Strings
composed of one or more characters. Indicated by enclosing a value in single, double, or triple quotes
17
New cards
Escape Character “\\”
changes the meaning of the character, appearing immediately afterwards
18
New cards
What can numbers be
Integers or Floating Point Numbers
19
New cards
Ints vs Float
Ints are whole numbers without a decimal point, floars have a decimal point
20
New cards
type
name of the built in function and we need to provide a variable as argument to this function
21
New cards
Typecasting
convert a value from one datatype to another datatype
22
New cards
What happens if you typecast a float into an integer
number is rounded down
23
New cards
What does input always read user data as
a string.
24
New cards
Formatted Output
Modifies the output according to the given pattern.
25
New cards
Multiline Strings
Triple Quotes
26
New cards
every program should have a ____, and every expression should have a__ ____
statement, variable/literal
27
New cards
What is //
Floor Division Operator
28
New cards
What does // do
rounds float down to nearest whole number
29
New cards
How can you tell if it is a logical expression
uses and/or
30
New cards
what does \*\* do
exponent
31
New cards
What does / print
float
32
New cards
What does % print
int
33
New cards
Overflow
when a value is too large to be stored in the memory allocated by the interpreter