what is a definite and what is a infinite loop?
for is definite while is inifinite.
what does type do?
what does this ouput then
st={}
print(type(st))
tells you type of thing it is
set
difference between compliers and interpreters?
open ended tell to google if we struggle
what is a way you can add a number to a set?
.add()
t/f
can a function return multiple values
t/f
A compound AND expression is only true if both conditions are met?
what kind of expression is this?
True
boolean expression
What does append do in a list?
adds a variable to the END of the list.
overwritting inhereted methods-
polymorphism
what does ^ do in regular expression
searches for letter at beginning
which of the following can be used as dictionary keys
intengers
strings
tuples
sets
true
true
true sorta
false
x=92
if x >=90: print('1')
if x>= 80: print('2')
if x >=70 print('3')
else print('4')
3
what are the 3 types of ways to handle a file?
what is best practice when finished with a file
read write append
close()
true or false: with respect to HTTP it describes the structure of a webpage
False
difference between break and continue
break breaks out of the loop continue continues running in the loop from start
how would I reverse the following function
x=('string')
s1='5'
s2=10
print(s1+s2)
'510'
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
what are augments? what are parameters? explain differences between 2
google if needed
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
def m()
->x=2 y=5
->A=x* func(y,x)
->print(A)
->def func(C,B):
->return(C+A*B)
m()
30
x=('forts friday')
x[-6:12]
friday
on the board write code to open a file write 'foobar' then read the file and count the letters
.
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.
l=[1,2,3,'4']
if (4 in l):
print('yipee')
else:
print('womp womp')
womp womp
t/f
serealization means converting an object in memory to a byte stream
true