Python Midterm

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 63

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

64 Terms

1
Hardware
physical components of a computer (case, mouse, monitor, fan, etc)
New cards
2
Central Processing Unit (CPU)
"Brain" of the computer that performs instructions defined by software
New cards
3
Main Memory
works with the CPU and stores a program and data (RAM- memory lost when powered off)
New cards
4
Secondary Storage Device
long-term memory that holds data (CD, DVD, USB, etc)
New cards
5
Input Device
collects the data and sends it to the computer (keyboard, mouse, etc)
New cards
6
Output Device
data is sent to these where it is presented (displays, printers, Word document, etc)
New cards
7
Software
the programs and other operating information used by a computer.
New cards
8
Binary

1 = on

0 = off

New cards
9
bit
binary digit ( 1 or 0 )
New cards
10
byte
store a letter or small number (8 bits)
New cards
11
machine language (low-level programming language)
series of 1s and 0s
New cards
12
programming language
allows programmers to communicate with a computer that we understand
New cards
13
Assembly Language
more human-like language, a step up from machine language
New cards
14
Assembler
converts Assembly to Machine
New cards
15
Python (high-level programming language
more like our native languages
New cards
16
keywords/ reserved words
has a specific meaning and cant be used for anything else (and, break, while, def, etc)
New cards
17
operators
preform various operations on data (+, -, ==,)
New cards
18
syntax
set of rules that must be strictly followed when writing a program
New cards
19
statement
individual instructions you use to write a program (keywords, operators, etc)
New cards
20
compiler
translate high-level language programs into machine language so the CPU can can understand it (BEFORE)
New cards
21
interpretor
translates and executes instructions of a high-level language program (DURING)
New cards
22
low-level
CPU dependent (not portable)
New cards
23
high-level
Not CPU dependent (portable)
New cards
24
Object
item in a program that contains data and can preform operations
New cards
25
properties/attributes
data in the Object
New cards
26
Methods
special type of procedure that belongs to an Object
New cards
27
algorithm
set of well-defined logical steps that allow a computer to solve a problem
New cards
28
algorithm make-up**

1. Well-ordered and unambiguous 2. be executable 3. solve the problem at hand 4. terminate

New cards
29
command = 'print'
statement = ("Hello World")
New cards
30
**Variable makeup

1. Name (identifier) 2. Value 3. Location 4. Type

New cards
31
string
"Alice"
New cards
32
integer
25
New cards
33
float
5.5
New cards
34
Boolean/bool
represents a Boolean value (Ture/Flase)
New cards
35
getting user input
name = input("Enter your name: ")
New cards
36
output (using f-strings)
print(f"Hello, {name}!")
New cards
37
Control Flow
conditional statements, loops (for..in and while)
New cards
38
conditional statement

if age >= 18:

print("You are an adult.")

elif age < 18:

print("You are a minor.")

else:

print("Invalid age.")

New cards
39
For Loop

for i in range(5):

print(i)

New cards
40
For loop ex

for x in range(10, 0, -1):

print(x)

else:

print(“Blast Off!”)

New cards
41

for X in my_List:

print (X)

don't have to define the variable before

New cards
42
While Loop ex.

count = 0

while count < 5: print(count)

count += 1

New cards
43
While Loop
execute code repeated as long as the condition remains TRUE
New cards
44
len
built-in function the number of items in the sequence
New cards
45

numbers = [1, 2, 3, 4, 5]

print(len(numbers))

5
New cards
46
function
block of reusable code that performs a certain task
New cards
47
function make-up

1. name (identifier) 2. return type 3. parameter list 4. body

New cards
48
def
defines the function
New cards
49
function name

def function_name()

call this function many times using the name but with a different parameters

New cards
50
return
exits the function
New cards
51
random module
import random "random.randrange(1,100,1)"
New cards
52
list
New cards
53
append
append an element to the end of a list
New cards
54
my_list.append(X)
New cards
55
Pop
"remove" or pop an index off the List
New cards
56
remove
remove an element from the list
New cards
57
my_List.remove(x)
New cards
58
local variable
inside a function; do not exist outside of it
New cards
59
global variable
outside a function
New cards
60
string
an array of characters
New cards
61
string concatenation
+
New cards
62
print (3 * "Hip")
duplicate the string
New cards
63
Data structures
way of organizing data so that it can be accessed more efficently
New cards
64
list
a container which stores a collection of related values; also a sequence
New cards

Explore top notes

note Note
studied byStudied by 18 people
899 days ago
5.0(1)
note Note
studied byStudied by 32 people
794 days ago
5.0(1)
note Note
studied byStudied by 1 person
28 days ago
5.0(1)
note Note
studied byStudied by 103 people
856 days ago
5.0(1)
note Note
studied byStudied by 3 people
761 days ago
5.0(1)
note Note
studied byStudied by 10 people
693 days ago
4.5(2)
note Note
studied byStudied by 39 people
953 days ago
5.0(1)
note Note
studied byStudied by 11 people
776 days ago
5.0(1)

Explore top flashcards

flashcards Flashcard (33)
studied byStudied by 3 people
792 days ago
5.0(1)
flashcards Flashcard (62)
studied byStudied by 5 people
765 days ago
5.0(1)
flashcards Flashcard (82)
studied byStudied by 10 people
56 days ago
5.0(1)
flashcards Flashcard (40)
studied byStudied by 5 people
171 days ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 115 people
507 days ago
5.0(1)
flashcards Flashcard (25)
studied byStudied by 12 people
468 days ago
5.0(1)
flashcards Flashcard (25)
studied byStudied by 2 people
661 days ago
5.0(1)
flashcards Flashcard (38)
studied byStudied by 38 people
8 days ago
5.0(1)
robot