Module 2

studied byStudied by 5 people
4.0(1)
Get a hint
Hint

What do comments start with

1 / 32

flashcard set

Earn XP

Description and Tags

33 Terms

1

What do comments start with

a #

New cards
2

Lines of code can be categorized into three categories. What are they?

Input, processing, and output

New cards
3

Input statements

used to get data and pass it onto the program for processing

New cards
4

Processing Statements

Implement logic that is used to process the input and turn it into useful information

New cards
5

Output statements

used to display information on the screen

New cards
6

Algorithm

list of well defined computer instructions that can be used to solve a problem

New cards
7

program/source code/ code

List of statements that implement an algorithm using a programming language like python

New cards
8

variables

hold data that we can reuse in our program by writing the same variable name

New cards
9

Assignment Operator

right of the = is executed first, and result is assigned to the variable on the left

New cards
10

print

built in function to output data on the console

New cards
11

Debugging

process of finding bugs in your programs and sorting them out

New cards
12

Syntax Errors

language mistakes done by a programmer while writing code

New cards
13

Logic Errors

Algorithm that is used in the program is wrong.

New cards
14

String vs. Numbers

Strings include quotations, numbers do not

New cards
15

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

New cards
16

Strings

composed of one or more characters. Indicated by enclosing a value in single, double, or triple quotes

New cards
17

Escape Character “\”

changes the meaning of the character, appearing immediately afterwards

New cards
18

What can numbers be

Integers or Floating Point Numbers

New cards
19

Ints vs Float

Ints are whole numbers without a decimal point, floars have a decimal point

New cards
20

type

name of the built in function and we need to provide a variable as argument to this function

New cards
21

Typecasting

convert a value from one datatype to another datatype

New cards
22

What happens if you typecast a float into an integer

number is rounded down

New cards
23

What does input always read user data as

a string.

New cards
24

Formatted Output

Modifies the output according to the given pattern.

New cards
25

Multiline Strings

Triple Quotes

New cards
26

every program should have a __, and every expression should have a ____

statement, variable/literal

New cards
27

What is //

Floor Division Operator

New cards
28

What does // do

rounds float down to nearest whole number

New cards
29

How can you tell if it is a logical expression

uses and/or

New cards
30

what does ** do

exponent

New cards
31

What does / print

float

New cards
32

What does % print

int

New cards
33

Overflow

when a value is too large to be stored in the memory allocated by the interpreter

New cards

Explore top notes

note Note
studied byStudied by 39 people
... ago
5.0(1)
note Note
studied byStudied by 3 people
... ago
5.0(1)
note Note
studied byStudied by 52 people
... ago
5.0(1)
note Note
studied byStudied by 3 people
... ago
5.0(1)
note Note
studied byStudied by 18 people
... ago
5.0(1)
note Note
studied byStudied by 12 people
... ago
5.0(1)
note Note
studied byStudied by 292 people
... ago
5.0(1)
note Note
studied byStudied by 160 people
... ago
5.0(1)

Explore top flashcards

flashcards Flashcard (40)
studied byStudied by 31 people
... ago
5.0(1)
flashcards Flashcard (48)
studied byStudied by 71 people
... ago
5.0(1)
flashcards Flashcard (28)
studied byStudied by 22 people
... ago
5.0(1)
flashcards Flashcard (23)
studied byStudied by 1 person
... ago
5.0(1)
flashcards Flashcard (25)
studied byStudied by 33 people
... ago
5.0(2)
flashcards Flashcard (83)
studied byStudied by 136 people
... ago
5.0(2)
flashcards Flashcard (32)
studied byStudied by 40 people
... ago
5.0(1)
flashcards Flashcard (106)
studied byStudied by 52 people
... ago
5.0(1)
robot