Docsity

Programming Paradigms Midterm 2, Exams of Programming Paradigms

Toggle sidebar
bg1
Programming Paradigms
Midterm 2
--strict flag - ANSshows you errors
add to dict d - ANSd[ ] = ' '
add to list l - ANSl.append
const - ANSmakes a variable that can't be changed
Delete a dictionary element - ANSdel d[ ]
dictionaries - ANSorganizes based on key
how to add types in TS - ANSname : type
interactive shell - ANSquick way to test out python
length of list l - ANSlen(l)
let - ANSmakes a variable
list - ANSorganizes based on id
pf3

Partial preview of the text

Download Programming Paradigms Midterm 2 and more Exams Programming Paradigms in PDF only on Docsity!

Programming Paradigms

Midterm 2

--strict flag - ANSshows you errors add to dict d - ANSd[ ] = ' ' add to list l - ANSl.append const - ANSmakes a variable that can't be changed Delete a dictionary element - ANSdel d[ ] dictionaries - ANSorganizes based on key how to add types in TS - ANSname : type interactive shell - ANSquick way to test out python length of list l - ANSlen(l) let - ANSmakes a variable list - ANSorganizes based on id

make dictionary d - ANSd:dict[ ] = { } make list named l - ANSl:list[ ]= [ ' ' ] making a function in python - ANSdef function: making a function in ts - ANSname() :void{ mapping - ANStransforming a group of values into another group of values pass in pyton - ANSused to say a function is empty print all of list l - ANSl[1:] print first in list l - ANSl[1] print last on list - ANSl[-1] printing on to console (ts) - ANSconsole.log('printing'); python loop - ANSfor i in range(0, 100): will run 100 times tsc - ANSconverts typescript into JavaScript tuple - ANSmakes groups of list, imputable