Comp Sci~ Exam 1

studied byStudied by 89 people
0.0(0)
get a hint
hint

Bits and Binary

1 / 78

encourage image

There's no tags or description

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

79 Terms

1

Bits and Binary

All data that is stored in a computer is converted to sequences of 0s and 1s.

New cards
2

Unicode

A character code that enables most of the languages of the world to be symbolized with a special character identification.

New cards
3

Hardware

The physical devices that a computer is made of .The programs that run on a computer are referred to as software.

New cards
4

Operating system

the software that supports a computer's basic functions, such as scheduling tasks, executing applications, and controlling peripherals.

New cards
5

IDE

a single program that gives you all of the tools you need to write, execute, and test a program.

New cards
6

IDLE

Provides a basic environment for editing and running programs.

New cards
7

Assembler

A(n) ____ reads assembly language code and converts it into machine language.

New cards
8

Compiler

A program that translates code in a high-level language (such as Java) to machine instructions (such as bytecode for the Java virtual machine).

New cards
9

Algorithm

A sequence of instructions that solves a problem

New cards
10

Input

variable =input('prompt')

New cards
11

Prompt

name= input ("what is your name? ") Zoey print ("My name is" ,name, ) or print (name) My name is Zoey or Zoey

New cards
12

int (item)

used when you are prompting the user to input whole numbers only

New cards
13

float (item)

used when the user is prompted to input numbers containing decimal (non-whole numbers)

New cards
14

Python is case-sensitive.

YES!! The upper-case and lower-case of a letter are distinct

New cards
15

python keywords

Protected, special words (tells Python you are about to define a function)

New cards
16

identifier

A candidate key that has been selected as the unique, identifying characteristic for an entity type.

New cards
17

invalid identifiers

  1. using names stored in the python Libra

  2. starting with a number

  3. using special characters like % or $ or @ or .

New cards
18

Notes on identifiers

sequence of letters (a-z, AZ), underscores (_), and digits (0-9), and must start with a letter or an underscore

New cards
19

Variable Statement

a name that represents a value stored in the computer's memory.

New cards
20

argument

The item passed to a function

New cards
21

denotes what

comments before actually writing the code helps organize

New cards
22

addition operator

New cards
23

subtraction operator

New cards
24

multiplication operator

New cards
25

/

division operator

New cards
26

//

integer divsion- divides one number by the other and gives the answer as an integer

New cards
27

%

remainder operator divides one number by the other and gives the remainder

New cards
28

+=

x += 5; x = x + 5

New cards
29

-=

y-=2, y=y-2

New cards
30

*=

y*=3 y=3*y

New cards
31

/=

a/=b a=a/b

New cards
32

%=

c%=3 c=c%3

New cards
33

string (str)

ordered sequence ('hello' 'Sammy' '2000')

New cards
34

lists (list)

Ordered sequence of objects: [10,"hello",200.3]

New cards
35

Dictionaries (dict)

Unordered Key:Value pairs: {"mykey" : "value" , "name" : "Frankie"}

New cards
36

Tuples (tup)

Ordered immutable sequence of objects: (10,"hello",200.3)

New cards
37

Sets (set)

Unordered collection of unique objects: {"a","b"}

New cards
38

Booleans (bool)

Logical value indicating True or False

New cards
39

( )

items in here are evaluated first think PEMDAS

New cards
40

unary

negative

New cards
41

**

exponent ( if you want 3^6 you put in python 3**6)

New cards
42

Types of Errors

Syntax, Logic, Runtime

New cards
43

how do you do a math function in python?

import math print the variable name to get the result of the math function performed .

New cards
44

math.sqrt

Returns the square root of a number

New cards
45

math.floor

Rounds a number down to the nearest integer

New cards
46

math.ceil

Rounds a number up to the nearest integer

New cards
47

math.fabs

Returns the absolute value of a number

New cards
48

math.pow

computes the exponent

New cards
49

math.factorial(x)

Returns the factorial of x

New cards
50

math.fmod(x,y)

returns the reminder

New cards
51

math.isnan(x)

Return True if x is a NaN (not a number), and False otherwise.

New cards
52

Which creates a string variable first_name with a value 'Daniel'? a. Daniel = first_name b. first_name = 'Daniel' c. first_name = Daniel

b. first_name = 'Daniel'

New cards
53

len function

returns the length of a sequence such as a list

New cards
54

greater than

New cards
55

<

less than

New cards
56

=

greater than or equal to

New cards
57

<=

less than or equal to

New cards
58

==

equal to

New cards
59

!=

not equal to

New cards
60

when using the operators what does python read it as

a question for example x>=y is x greater than or equal to y?

New cards
61

if statement

t is used to create a decision structure, which allows a program to have more than one path of execution. The statement causes one or more statements to execute only when a Boolean expression is true.

New cards
62

Boolean Expression

in programming, an expression that evaluates to True or False.

New cards
63

what is needed for an if statement to run properly

an indention.

New cards
64

assignment (floor=13)

makes something true

New cards
65

equality (if floor== 13)

checks if something is true

New cards
66

AND operator

Connects two Boolean expressions into one compound expression, BOTH subexpressions must be true for the expression to be true

New cards
67

OR operator

Connects two Boolean expressions into one compound expression one or both subexpressions must be true for the expression to be true it doesn't matter which

New cards
68

NOT operator

one of the logical operators; reverses the truth-value of a condition

New cards
69

true and true

true

New cards
70

true and false

false

New cards
71

false and true

false

New cards
72

false and false

false

New cards
73

true or false

true

New cards
74

true or true

true

New cards
75

false or true

true

New cards
76

false or false

false

New cards
77

if-else statement

Allows your program to perform one action if the expression evaluates to true and a different action if the expression evaluates to false.

New cards
78

elif

stands for else if. if the first test evaluates to False, continues with the next one

New cards
79

else statement

if if statement isn't true (doesn't run) this will

New cards

Explore top notes

note Note
studied byStudied by 10 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 16 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 4 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 2637 people
Updated ... ago
5.0 Stars(5)

Explore top flashcards

flashcards Flashcard124 terms
studied byStudied by 87 people
Updated ... ago
4.4 Stars(7)
flashcards Flashcard100 terms
studied byStudied by 17 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard101 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard45 terms
studied byStudied by 10 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard94 terms
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard120 terms
studied byStudied by 36 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard35 terms
studied byStudied by 12 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard74 terms
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)