Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Python Programming
Quiz 1: Python Programming: Output and Data Types
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 21
Multiple Choice
What is the output of the following program? Data = [x for x in range(5) ] Temp = [x for x in range(7) if x in data and x%2==0] Print(temp)
Question 22
Multiple Choice
What is the output of the following program? L1 = [1, 2, 3, 4] L2 = L1 L3 = L1.copy() L4 = list(L1) L1[0] = [5] Print(L1, L2, L3, L4)
Question 23
Multiple Choice
What is the output of the following program? Import sys L1 = tuple() Print(sys.getsizeof(L1) , end = " ") L1 = (1, 2) print(sys.getsizeof(L1) , end = " ") L1 = (1, 3, (4, 5) ) Print(sys.getsizeof(L1) , end = " ") L1 = (1, 2, 3, 4, 5, [3, 4], 'p', '8', 9.777, (1, 3) ) Print(sys.getsizeof(L1) )
Question 24
Multiple Choice
What is the output of the following program? T = (1, 2, 3, 4, 5, 6, 7, 8) Print(T[T.index(5) ], end = " ") Print(T[T[T[6]-3]-6])
Question 25
Multiple Choice
What is the output of the following program? L = [1, 3, 5, 7, 9] Print(L.pop(-3) , end = ' ') Print(L.remove(L[0]) , end = ' ') Print(L)
Question 26
Multiple Choice
What is the output of the following program? Def REVERSE(L) : (L) reverse() Return(L) Def YKNJS(L) : List = list() List.extend(REVERSE(L) ) Print(List) L = [1, 3.1, 5.31, 7.531] YKNJS(L )
Question 27
Multiple Choice
What is the output of the following program? From math import sqrt L1 = [x**2 For x in range(10) ].pop() L1 + = 19print(sqrt(L1) , end = " ") L1 = [x**2 for x in reversed(range(10) ) ].pop() L1 + = 16 Print(int(sqrt(L1) ) )
Question 28
Multiple Choice
What is the output of the following program? D = dict() For x in enumerate(range(2) ) : D[x[0]] = x[1] D[x[1]+7] = x[0] Print(D)
Question 29
Multiple Choice
What is the output of the following program? D = {1 : 1, 2 : '2', '1' : 1, '2' : 3} D['1'] = 2 Print(D[D[D[str(D[1]) ]]])
Question 30
Multiple Choice
What is the output of the following program? D = dict() For i in range (3) : For j in range(2) : D[i] = j Print(D)
Question 31
Multiple Choice
What is the output of the following program? From math import * A = 2.13b = 3.7777 C = -3.12 Print(int(a) , floor(b) , ceil(c) , fabs(c) )
Question 32
Multiple Choice
What is the output of the following program? Import string Line1 = "And Then There Were None" Line2 = "Famous In Love" Line3 = "Famous Were The Kol And Klaus" Line4 = Line1 + Line2 + Line3 Print(string.find(Line1, 'Were') , string.count((Line4) , 'And') )
Question 33
Multiple Choice
What is the output of the following program?line = "What will have so will"L = line.split('a') for i in L:print(i, end=' ')
Question 34
Multiple Choice
What is the type of each element in sys.argv?
Question 35
Multiple Choice
What is the length of sys.argv?
Question 36
Multiple Choice
What is the output of the following code? Def foo(k) : K[0] = 1 Q = [0] Foo(q) Print(q)
Question 37
Multiple Choice
What is the output of the following code? Def foo(fname, val) : Print(fname(val) ) Foo(max, [1, 2, 3]) Foo(min, [1, 2, 3])
Question 38
Multiple Choice
What is the output of the following? Elements = [0, 1, 2] Def incr(x) : Return x+1 Print(list(map(elements, incr) ) )
Question 39
Multiple Choice
What is the output of the following? Elements = [0, 1, 2] Def incr(x) : Return x+1 Print(list(map(incr, elements) ) )
Question 40
Multiple Choice
What is the output of the following? Def to_upper(k) : Return k.upper() X = ['ab', 'cd'] Print(list(map(to_upper, x) ) )
showing 21 - 40 of 48
Prev
Next
Prev
1
2
3
Next
Related Quizzes
Previous slide
Next slide
Access For Free