1/41
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Real Definitions
Capture real nature of a thing.
Nominal definitions
Objects have no real nature, qualities are what we make them
Lexical Definitions
describe what people mean when they utter it. All usage of a word
Precising Definitions
Comprise of all definitions. Cleans up boundaries about application of word
Technology as Applied Science
Tech is electronics and comp sci, applied science. Tech predates science, tools were always there, so not accurate
Tech as Hardware
Mechanical inventions defined industrial revolution, but tech without knowledge of use is useless
Tech as Rules: Technique
Rules of activity
Humans adapt to tech
Tech as a system
includes science, hardware, and know-how
Everything works together
Python is a software system called an ________
interpreter
interpreter
layer of logic between code and computer hardware
Reads your program and carries it out
Steps when Python is told to run script:
Compiled into bytecode
Routes to Virtual Machine, which carries out the code
Byte code
Lower level representation of source code (what you input). Decomposition of it into individual steps.
Python specific format, not binary machine code
PVM (Python Virtual Machine)
It’s a big code loop that gets the compiled bytecode and goes through it one instruction at a time to carry it out.
Norvig Recipe for Success
Do something because it’s fun
Learn by doing
Talk with others who do the same
College
Projects with other
Projects after others
Rubber Duck Debugging
Basic idea is talking out loud about something allows you to better understand it and actually solve the problem (if there is one)
Conceptual Hierachy of Python
Programs
Modules
Statements
Expressions
(create and process) Objects
Objects
Everything in python: Numbers, lists, functions, modules
Types
int - integers
float - decimal
bool - true/false
str - string(text)
Collections
List [1,2,3] - mutable
tuple (1,2,3) - immutable
set {1,2,3} - unordered
dict{‘a‘:1, ‘b’:2 } - key-value
Variable
Name that refers to an object
Items
Separate things in a list
3 Error Types
Syntax
Semantic
Style
Syntax
Rules or code fails
greeting = “Hello World!”
Print(Greeting)
Case sensitivity. g and G are different letters
Semantic
Code is run successfully, but not what we wanted to do
myvar = “hello”
print(”myvar”)
Style
camelCase (mix of upper/lowercase letters for variable names)
Not writing in consistent style
Indentation errors, write for humans
.append()
add at the end of a list
.append(“hello“)
for loop
for *each item* in list/set/etc.:
Do this
.remove()
remove specific thing from list
.remove(“Thompson“)
.insert()
insert something in the list at a certain index.
.insert(indexnumb, “”)
.extend()
if you have a list, extend it with what’s actually in it, not just adding it in
example
my_list = [1, 2, 3]
vet_roster.extend(my_list)
print(vet_roster)
['Bradley', 'Pickleback', 5, 1, 2, 3] → .append() would’ve outputed ['Bradley', 'Pickleback', 5, [1, 2, 3]]
input()
prompts user input
user_input = input('type a number: ')
.items()
for dictionary objects, allows you to use both key and value
for capital in locations.items():
print(f"{capital[0]} is the capital of {capital[1]}!")
.set()
Turns the list into a set
fa_cup_winners_set = set(fa_cup_winners)
What is informatics
applied computing. computer applications in the every day
foundations in science, industry, and success
Intersection of people, info, tech system (interdisciplinary)
Rubber Duck Debugging and Effect
Explaining code out loud step-by-step
Self Explanation
Cognitive Load Theory
Psychological Distance
Metacognition
self explanation effect
Someone who can explain something to someone else is better able to understand the material
Cognitive Load Theory
Brains can only handle so much information at once. Externalizing it by speaking, writing, etc, you ease mental strain and free up working memory to focus on the problem
Psychological Distance
When you’re submerged in the problem, can’t see clearly. Emotions get in the way. Explaining it takes you out of the problem, making it more objective
Metacognition
thinking about thinking, Forces you to break down problem, reflect on your attempts, and look at process
can spot gaps in logic
Nested list
lists in lists
Accessed with multiple brackets
matrix = [[1,2,3], [4,5,6]]
matrix[1][0] would yield 4
list()
turns into list
.pop()
remove an item, but different
.remove() can’t be used with dictionaries
.pop() used index for lists, and key name for dictionaries