pythonSC
tuple
(1, )
tuple
no, T is tuple, and tuple is immutable.
yes, del T
True
What is the difference between these two ways of reversing elements in a list?
One is mutation , another is immutation.
Yes, FIFO
Yes, FILO
It's less efficient, because tuple is immutable so it need to create another new tuple every time you pop and push.
After executing the following sequence of statements:
what is the value of y?
After executing the following sequence of statements
what is the value of y?
After executing the following sequence of statements
what is the value of y?
After executing the following sequence of statements
what is the value of y?
After executing the following sequence of statements
what is the value of x?
After executing the following sequence of statements
what is the value of x?
After executing the following sequence of statements
what is the value of y?
After executing the following sequence of statements
what is the value of y?
After executing the following sequence of statements
what is the value of y?
After executing the following sequence of statements
what is the value of y?
After executing the following sequence of statements
what is the value of y?
What is the type of {}?
set
What is the expression for an empty set?
set()
Which of the following can or cannot be a member of a set? Why?
What is the value of len(set('hello'))?
What is the value of each of the following expressions?
What is the result of the following comparisons?
Assume S = 1, 2, 3}, what is the difference between
S = S and S |= {3, 4}?
one is mutation another is non-mutation
Assume D = {'Sun': 0, 'Mon': 1, 'Tue': 2, 'Wed': 3}
What is the value of D['Mon']?
What is the value of D after D['Thu'] = 4?
Continuing with the previous statement, what is the value of D after D['Sun'] = 7?
What happens if you attempt print(D['Fri'])?
Assume D = {'Sun': 0, 'Mon': 1, 'Tue': 2, 'Wed': 3}
What is the value of D.keys()
What is the value of D.values()
What is the value of D.items()
Assuming D = {}, which of the following is legal or not legal in Python? If not legal, why not?