Python Essentials | Part 1 Summary Test-Questions and Answers
112 views 0 purchase
Course
Programming for python language..
Institution
Programming For Python Language..
Python Essentials | Part 1 Summary Test-Questions and Answers
1. Which of the following lines incorrectly. invokes the function defines as:
def fun (a, b, c=0) : - ANSWER-fun (
2. What is the output of the following snippet?
list = [x * x for x in range (5) ]
def fun (1st) :
del 1st [1st ...
Python Essentials | Part 1 Summary Test-Questions and Answers 1. Which of the following lines incorrectly. invokes the function defines as:
def fun (a, b, c=0) : - ANSWER-fun (
2. What is the output of the following snippet?
list = [x * x for x in range (5) ]
def fun (1st) : del 1st [1st [2] ] return 1st
print (fun (list) ) - ANSWER-[ ]
3. How many elements does the 1st list contain?
1st = [i for i in range (-1, -2) ] - ANSWER-One, Two, Three, Zero
4. What is the output of the following snippet?
dct = {}
dct [ '1' ] = (1, 2)
dct [ '2' ] = (2, 1)
for x in dct.keys () : print (dct [x] [1] ,enf="") - ANSWER-12 or (1,2) or 21 or (2,1)
5. Assuming that the "tuple" is a correctly created tuple, the fact that tuples are immutable means that the following instruction:
tuple [1] = tuple [0] - ANSWER-
6. The following snippet:
def func(a, b) : return b ** a print (func (b=2, 2) ) - ANSWER-
7. What is the output of the following piece of code?
print ("a", "b", "c", sep="sep") - ANSWER-
8. An operator able to check whether two values are not equal is coded as: - ANSWER-
9. What is the output of the following snippet?
dct = { 'one' : 'two', 'three' : 'one, 'two' : 'three' }
v =v dct ['three'] for k in range (len(dct) ) : v = dct [v]
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller EricMatt. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $7.99. You're not tied to anything after your purchase.