• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/34

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

34 Cards in this Set

  • Front
  • Back

definite loop

allows user to repeat a number of actions or a sequence multiple times until the loop ends.


for in :


(->indent)



accumulator design pattern

calculates a sum (or another accumulation) using repetition and arithmetic. It involves three steps:


1. setup accumulator variable


2. use a loop to process inputs/values


3. after the loop, use the accumulated result

indefinite loop

allows user to repeat a number of actions or a sequence multiple times without an end to the loop


general form:


while :


(indent)


(indent)


(indent)

sentinel-controlled loop

has one value that end collecting inputs.

functions

re-usable pieces of code grouped together and labeled with an identifier. Take parameters as inputs and return values as outputs

literals

hard-coded input


ex. print('hello world')



expressions

statements that produce a value


ex) 3+ 5

variables

represents an expression, number


ex) x = float(input("enter your favorite number:"))


x is the variable.


store the number, expression

identifiers

name that refers to a variable


ex) amountInPeso

print("the ratio of circumference to diameter is %.4f" % math.pi)

%.4f % math.pi - trigger the numeric formatting


%.4f % math.pi - tells how many decimal places to round


%.4f % math.pi - indicates that this is a float


%.4f % math.pi - indicates the replacement operator. not the remainder


%.4f % math.pi - what pi equals


the result is the substitution of 3.1456 into string

parameters

the inputs to a function

return value

the outputs of a function

objects

active database that have both data and actions that operate on that data

ASCIII codes

computer stores individual characters of text in these codes where each individual character, non-alphabetical symbols and upper/lower case letters are each assigned a value

encoding

ord() - character to number

decoding

ch() - number to character

scalar variable

a single spot in memory tat can hold 1 value

list

an abstract data type that holds multiple values and supports sequence operations. Are also objects that have useful methods

ADT

stores primitive data types. has operations that allow user to append, delete, insert and view

dictionary

an associative relation of key to value pairs.

results of SELECT query

the data table for the information you requested. it can fetch all data from the table. cursor.fetchall

results of DELETE query

the number of rows of data affected - removed from the requested data. cursor.rowcount

JOIN clause

pulls information from one table and joins it with the information from another table to display data from both because they have a relationship

WHERE clause

pull the specific key you want to obtain

web application

a program (script) that generates a web page dynamically. the application runs every time the web browser loads the page

HTML forms

used to collect user input. contains form elements. send data to the webserver as specified by a parameter called action

Common Gateway Interface (CGI)

application waiting to process a form. requires a non-trivial script on the server to process the data.Python's CGI module provides access to a dict of all form fields and their




values:cgi.FieldStorage() functionif form.has_key("NAME"):name = form["NAME"].valueprint hello(name)

checklist for resolving INTERNAL SERVER ERRORS

1. python syntax error - do "run/check module" within IDLE and fix all errors


2. Missing or incorrect shebang line; should be: #!usr/bin/python


3. incorrect permissions: should be 755


4. missing HTTP headers (ie. "Content-type: text/html" followed by print


5. smart quotes are NOT valid ASCII characters. must be " " and ' '

HTML links

enables us to create hypertext references (links) - text or an image you can click on and jump to another document




general format:


< a href="bu.edu" > BU web page



HTML

hypertext markup language that are scripts of codes used to create web servers.




HTML has tags that are keywords surrounded by angle brackets




contains different elements to generate web applications that allow users to interact with web server

shebang line

#!/usr/bin/python




a directive to tell the web server where to find the python interpreted

main section of the program

if statement:


if_ _name_ _==_ _"main_ _":

name attribute

HTML form fields identified at the server.


it is important because they are referred to later in the main section

Action attribute

element of the form associates the form with the web application. there is a URL that connects the HTML form with web application