exam 1 material
exam 2 material
post exam 2 material
mystery
mystery
100

what is a definite and what is a infinite loop?

for is definite while is inifinite.

100

what does type do?

what does this ouput then

st={}

print(type(st))

tells you type of thing it is

set

100

difference between compliers and interpreters?

open ended tell to google if we struggle

100

what is a way you can add a number to a set?

.add()

100

t/f

can a function return multiple values

true
200

t/f

A compound AND expression is only true if both conditions are met?

what kind of expression is this?

True

boolean expression

200

What does append do in a list?

adds a variable to the END of the list.

200

overwritting inhereted methods-

polymorphism

200

what does ^ do in regular expression

searches for letter at beginning

200

which of the following can be used as dictionary keys
intengers
strings
tuples
sets

true

true

true sorta

false

300

x=92

if x >=90: print('1')

if x>= 80: print('2')

if x >=70 print('3')

else print('4')

3

300

what are the 3 types of ways to handle a file?

what is best practice when finished with a file

read write append

close()

300

true or false: with respect to HTTP it describes the structure of a webpage

False

300

difference between break and continue

break breaks out of the loop continue continues running in the loop from start

300

how would I reverse the following function

x=('string')

[::-1]
400
output of following code

s1='5'

s2=10

print(s1+s2)

'510'

400

explain how lists sets and tuples react to having a repeated element added to them

lists allow duplicates

sets do not and will just pretend like you didnt

tuples can have repeated ones but you cant add to a tuple

400

what are augments? what are parameters? explain differences between 2

google if needed

400

t/f

in reg ex the repeat charcters (* and +) push outward in both directions which is called non-greedy

false its not called non greedy

400

def m()

->x=2 y=5

->A=x* func(y,x)

->print(A)

->def func(C,B):

->return(C+A*B)

m()


30

500

x=('forts friday')

x[-6:12]


friday

500

on the board write code to open a file write 'foobar' then read the file and count the letters

.

500

what protocol is used for reliable communication

give an example in web browsing and ip phone application

tcp

  • Web browsers use TCP to communicate with web servers.

  • When you visit a website (e.g., typing a URL in Chrome), your computer establishes a TCP connection (usually on port 80 for HTTP or 443 for HTTPS).

  • Example:
    Loading https://www.example.com uses TCP to ensure all the website’s files (HTML, images, scripts, etc.) arrive reliably.

2. IP Phone Application (VoIP)

  • VoIP apps (like Skype, Zoom, or Cisco IP phones) sometimes use TCP for reliable transport, such as for signaling (call setup/teardown), user authentication, or when your VoIP data must not be lost.

  • However, audio and video streams often use UDP (because it’s faster and minor loss is acceptable), but control signals (e.g., SIP protocol for call setup) typically use TCP to guarantee delivery.


500

l=[1,2,3,'4']

if (4 in l):

print('yipee')

else:

print('womp womp')

womp womp

500

t/f

serealization means converting an object in memory to a byte stream

true

M
e
n
u