Module 2

studied byStudied by 4 people
4.0(1)
get a hint
hint

What do comments start with

1 / 32

Studying Progress

0%
New cards
33
Still learning
0
Almost done
0
Mastered
0
33 Terms
1
New cards

What do comments start with

a #

New cards
2
New cards

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

Input, processing, and output

New cards
3
New cards

Input statements

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

New cards
4
New cards

Processing Statements

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

New cards
5
New cards

Output statements

used to display information on the screen

New cards
6
New cards

Algorithm

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

New cards
7
New cards

program/source code/ code

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

New cards
8
New cards

variables

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

New cards
9
New cards

Assignment Operator

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

New cards
10
New cards

print

built in function to output data on the console

New cards
11
New cards

Debugging

process of finding bugs in your programs and sorting them out

New cards
12
New cards

Syntax Errors

language mistakes done by a programmer while writing code

New cards
13
New cards

Logic Errors

Algorithm that is used in the program is wrong.

New cards
14
New cards

String vs. Numbers

Strings include quotations, numbers do not

New cards
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

New cards
16
New cards

Strings

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

New cards
17
New cards

Escape Character “\”

changes the meaning of the character, appearing immediately afterwards

New cards
18
New cards

What can numbers be

Integers or Floating Point Numbers

New cards
19
New cards

Ints vs Float

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

New cards
20
New cards

type

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

New cards
21
New cards

Typecasting

convert a value from one datatype to another datatype

New cards
22
New cards

What happens if you typecast a float into an integer

number is rounded down

New cards
23
New cards

What does input always read user data as

a string.

New cards
24
New cards

Formatted Output

Modifies the output according to the given pattern.

New cards
25
New cards

Multiline Strings

Triple Quotes

New cards
26
New cards

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

statement, variable/literal

New cards
27
New cards

What is //

Floor Division Operator

New cards
28
New cards

What does // do

rounds float down to nearest whole number

New cards
29
New cards

How can you tell if it is a logical expression

uses and/or

New cards
30
New cards

what does ** do

exponent

New cards
31
New cards

What does / print

float

New cards
32
New cards

What does % print

int

New cards
33
New cards

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 5 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 60 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 69 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 347 people
Updated ... ago
5.0 Stars(6)
note Note
studied byStudied by 19 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 3234 people
Updated ... ago
4.8 Stars(19)

Explore top flashcards

flashcards Flashcard60 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard100 terms
studied byStudied by 4 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard100 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard500 terms
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard77 terms
studied byStudied by 24 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard49 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard188 terms
studied byStudied by 194 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard34 terms
studied byStudied by 236 people
Updated ... ago
5.0 Stars(1)