Python - IT and Informatics

5.0(1)
studied byStudied by 60 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/41

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.

42 Terms

1
New cards

Real Definitions

Capture real nature of a thing.

2
New cards

Nominal definitions

Objects have no real nature, qualities are what we make them

3
New cards

Lexical Definitions

describe what people mean when they utter it. All usage of a word

4
New cards

Precising Definitions

Comprise of all definitions. Cleans up boundaries about application of word

5
New cards

Technology as Applied Science

Tech is electronics and comp sci, applied science. Tech predates science, tools were always there, so not accurate

6
New cards

Tech as Hardware

Mechanical inventions defined industrial revolution, but tech without knowledge of use is useless

7
New cards

Tech as Rules: Technique

Rules of activity

Humans adapt to tech

8
New cards

Tech as a system

includes science, hardware, and know-how

Everything works together

9
New cards

Python is a software system called an ________

interpreter

10
New cards

interpreter

layer of logic between code and computer hardware

Reads your program and carries it out

11
New cards

Steps when Python is told to run script:

Compiled into bytecode

Routes to Virtual Machine, which carries out the code

12
New cards

Byte code

Lower level representation of source code (what you input). Decomposition of it into individual steps.

Python specific format, not binary machine code

13
New cards

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.

14
New cards

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

15
New cards

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)

16
New cards

Conceptual Hierachy of Python

Programs

Modules

Statements

Expressions

(create and process) Objects

17
New cards

Objects

Everything in python: Numbers, lists, functions, modules

18
New cards

Types

int - integers

float - decimal

bool - true/false

str - string(text)

19
New cards

Collections

List [1,2,3] - mutable

tuple (1,2,3) - immutable

set {1,2,3} - unordered

dict{‘a‘:1, ‘b’:2 } - key-value

20
New cards

Variable

Name that refers to an object

21
New cards

Items

Separate things in a list

22
New cards

3 Error Types

Syntax

Semantic

Style

23
New cards

Syntax

Rules or code fails

  • greeting = “Hello World!”

  • Print(Greeting)

    • Case sensitivity. g and G are different letters

24
New cards

Semantic

Code is run successfully, but not what we wanted to do

  • myvar = “hello”

    • print(”myvar”)

25
New cards

Style

camelCase (mix of upper/lowercase letters for variable names)

Not writing in consistent style

Indentation errors, write for humans

26
New cards

.append()

add at the end of a list

.append(“hello“)

27
New cards

for loop

for *each item* in list/set/etc.:

Do this

28
New cards

.remove()

remove specific thing from list

.remove(“Thompson“)

29
New cards

.insert()

insert something in the list at a certain index.

.insert(indexnumb, “”)

30
New cards

.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]]

31
New cards

input()

prompts user input

user_input = input('type a number: ')

32
New cards

.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]}!")

33
New cards

.set()

Turns the list into a set

fa_cup_winners_set = set(fa_cup_winners)

34
New cards

What is informatics

applied computing. computer applications in the every day

foundations in science, industry, and success

Intersection of people, info, tech system (interdisciplinary)

35
New cards

Rubber Duck Debugging and Effect

Explaining code out loud step-by-step

Self Explanation

Cognitive Load Theory

Psychological Distance

Metacognition

36
New cards

self explanation effect

Someone who can explain something to someone else is better able to understand the material

37
New cards

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

38
New cards

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

39
New cards

Metacognition

thinking about thinking, Forces you to break down problem, reflect on your attempts, and look at process

can spot gaps in logic

40
New cards

Nested list

lists in lists

Accessed with multiple brackets

matrix = [[1,2,3], [4,5,6]]

matrix[1][0] would yield 4

41
New cards

list()

turns into list

42
New cards

.pop()

remove an item, but different

.remove() can’t be used with dictionaries

.pop() used index for lists, and key name for dictionaries