business programming midterm

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/21

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.

22 Terms

1
New cards

terminal

  • way to use computer from far (used in 60-70s) 

    • Gives screen, keyboard and connection to computer/what actually using 

    • Not actual computer

2
New cards

command line/prompt

text based interface for giving machine commands

3
New cards

shell

  • interpreter → the program that interprets the text as a command to the computer 

    • Ex: powershell 

    • Bash =  born again shell   

    • Zsh → z shell

4
New cards

tuple

  •  fixed list → once u create list u cannot change it 

    • Use () 

    • Is immutable

5
New cards

list

  • denoted by []

    • Is mutable → can change/edit once made

6
New cards

array

  • Index for lists start at 0 

    • Ex: like u want to see something in list and get 1st item the position is 0   

  • Can also start right to left at -1 

    • Ex: in hello[-1] → returns ‘o’

7
New cards

float

  •  floating point (number type) →decimal 

    • Ex: 3.4

8
New cards

string

  • for text 

    • Can wrap text in single or double quotes (‘ ‘ or “”) 

      • Choose 1 & be consistent

9
New cards

*args

  • the asterisk is specific character that can go in front of 1 variable in a functions definition → should come after all of required/keyword arguments & is tuple that can capture extra inputs to the function 

    • This allows for optional arguments that are variable in length → thing of a sum function 

    • Usually used as “args but can replace variable name “args” with anything u want 


10
New cards

**kwargs

  • Also allows for variable # of keyword inputs

    • ** ” can be put in front of any variable name but kwargs is usually used

    •  Think of like user of function being able to input their own variable/inputs

11
New cards

function

(also called “method”)

  • is a transaction between input & output.

    • Can hv no input, 1 input, many, etc 

      • Input can be named or not 

      • Can be optional or required 

    • def firstfunction ():

   Pass (code)

12
New cards

global variable

can be seen anywhere in program

13
New cards

local variable

  • only seen in their local context

  • ex: ???

14
New cards

conditionals (if/elif/else) 

  • Words in language that allow parts of programs to run depending on the conditions

full syntex:

  • #Check boolean statement 

    • If <statement is true>: 

      • #code block

  • Elif  <another statement> is True: 

    • # check other boolean 

      • <code block>

15
New cards

pass 

  • throw away word (used in functions) to make grammar checker happy & is for things not finished yet 

    • Makes python interpreter happy

16
New cards

block

  • collection of code meant to be group tg 

    • Specified with white space

  • Python is very sensitive to white space and spaces → bx space = grouping of code

17
New cards

for loop 

  • goes for some fixed number of times 

    • Ex: “do something for each item in list” or “do this 10 times”

18
New cards

while loop

  • executes block of code as long as some condition is true 

    • If accidentally create infinite loop (neverending) → Click Ctrl C

      • This will interrupt and stop loop 

19
New cards

range type 

  • Behaves like list where values are same as indices

    • Bc can save space & doesnt need to store all the values 

      • Saves current value, update value & stop value

20
New cards

full form of range

  • range(start, stop, step) 

  • Start value default is 0 

  • Stop value required 

  • Step rule default is “+1”

21
New cards

comprehension

  •  where creating collection where starts off empty & populate it w a for loop 

    • Can take at least 3 lines of code & compress this into a single line (of code)

  • add example code

22
New cards

 word "enumerate"

  • will return 2 things about a list/tuple → index & value

  •  used to get both the index & value at the same time