Notes: Chapter 1-7 Introduction to Computers and Python

0.0(0)
studied byStudied by 1 person
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/32

flashcard set

Earn XP

Description and Tags

Flashcards covering key concepts from the lecture notes on how computers work, binary numbers, and the Python environment and basics.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

33 Terms

1
New cards

What is the CPU and what does it do in a computer?

The central processing unit is the computer's brain; it executes the program's instructions.

2
New cards

What are RAM and the hard disk, and how do they differ in speed and volatility?

RAM is fast, volatile memory used while a program runs; the hard disk (or SSD) is slower, permanent storage.

3
New cards

Describe the life cycle of a program from storage to execution.

A program sits on the hard drive, you double-click to load it into RAM, and the CPU executes its steps one at a time.

4
New cards

What is an instruction and how does it relate to an algorithm?

An instruction is a single operation; a correct sequence of instructions forms an algorithm.

5
New cards

What does a compiler do?

Translates symbolic code written by humans into binary instructions that the CPU can execute.

6
New cards

What is the relation between symbols and binary information in computing?

Humans write symbols; computers store and process binary data; a compiler translates symbols to binary.

7
New cards

How is text represented in binary using ASCII in the lecture notes?

ASCII maps symbols to binary patterns; for example, decimal 65 maps to the symbol shown as 'a' in the notes.

8
New cards

What is a bit and how is it physically represented?

A bit is the basic 0 or 1 value, stored by charging or discharging a transistor.

9
New cards

What is a byte and how many bits does it contain?

A byte is eight bits and typically represents a single character.

10
New cards

What is Moore's Law as described in the notes?

Transistors double roughly every year, enabling more RAM, CPU, and storage, with the trend described up to around 2025.

11
New cards

What is the difference between symbolic information and digital information?

Symbolic information (humans' symbols) is translated into digital binary information the computer can process.

12
New cards

What is binary (base-2) and how many digits does it use?

Binary uses digits 0 and 1; each position represents a power of two.

13
New cards

What is the purpose of the binary subscript, such as _2, when writing numbers?

It indicates the number is written in base-2 (binary) rather than decimal.

14
New cards

How is the decimal number 26 represented in binary, using the power-series approach?

26 in binary is 11010.

15
New cards

How do you convert a decimal number to binary using divide-by-two? (Example: 109)

Divide by two repeatedly, recording remainders; read remainders in reverse order to get 109 in binary as 1101101.

16
New cards

What is the purpose of the binary subscript in numbers, and how would you read 1010_2?

The subscript tells you the base; 1010_2 is the binary representation of a number.

17
New cards

What are the basic Python data types mentioned and how do you denote strings?

Int for integers, Float for real numbers, Str for strings (strings are written with quotes).

18
New cards

What is a Python value or object?

A value (or object) is a piece of data that the program manipulates; in Python, value and object are the same concept.

19
New cards

What is a Python function, and what is an example?

A function is a reusable block of code; print() is a built-in function used to display output.

20
New cards

What is a Python comment and how is it written?

A comment starts with # and is ignored by Python; used for human-readable notes.

21
New cards

What is the file extension for Python scripts and how are they run in the example?

Python scripts use the .py extension; run via the IDE's run button or from a Python shell.

22
New cards

What is the difference between division / and floor division // in Python?

/ returns a floating-point result; // returns the floor (integer) result for integers (and a float if any operand is float).

23
New cards

What is the effect of the expression 5 / 2 in Python?

It yields 2.5 as a float.

24
New cards

What is the order of operations in Python?

Exponentiation (**) first, then multiplication/division, then addition/subtraction; use parentheses to override.

25
New cards

What is the purpose of the Python shell in an IDE and why is it useful?

An interactive prompt that lets you try commands before writing a full program; acts as a sandbox.

26
New cards

What is the significance of the 'Hello World' program in Python?

A first simple program to verify the environment by printing a string.

27
New cards

Why are file formats like BMP and PNG mentioned, and what role do file extensions play?

Different formats store binary data in different ways; file extensions help indicate how bits are stored/interpreted.

28
New cards

How does Python represent negative numbers according to the notes?

Python uses an extra bit to indicate sign, with negative numbers shown using that sign bit in the binary representation.

29
New cards

What is the relationship between Python abstractions (integers and characters) and the underlying binary representation?

Python shows integers and characters in a friendly form, but underneath they are stored as binary; Python handles the encoding/decoding automatically.

30
New cards

What is the recommended approach to solving programming problems as described, including breaking into pieces?

Break a complex problem into smaller subproblems, define each subproblem, write and test its algorithm, then integrate.

31
New cards

What is the 'algorithm' in programming language terms?

An algorithm is the correct order of instructions that perform a task when implemented in a programming language.

32
New cards

What is the role of a 'current step' in the CPU diagram in the notes?

It shows the instruction the CPU is about to execute; steps are fetched and executed one at a time in sequence.

33
New cards

What are some examples of common Python types shown and how are they printed or identified?

Examples include int, float, and str; type() reveals the type (e.g., class int, class float, class str).