Services
Discover
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
Exam 1: Python Programming: Output and Data Types
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 1
Multiple Choice
What is the output of the following program : I = 0 While i < 3: Print i Print i+1
Question 2
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 3
Multiple Choice
What is the output of the following code? Def foo(k) : K[0] = 1 Q = [0] Foo(q) Print(q)
Question 4
Multiple Choice
What is the output of the expression : 3*1**3
Question 5
Multiple Choice
What is the output of the following program : Print '{0:-2%}'.format(1.0 / 3)
Question 6
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 7
Multiple Choice
What is the output of the following? X = ['ab', 'cd'] Print(len(list(map(list, x) ) ) )
Question 8
Multiple Choice
What is the output of the following program : Print 0.1 + 0.2 == 0.3
Question 9
Multiple Choice
What will be displayed by the following code? Def f(value, values) : V = 1 Values[0] = 44 T = 3 V = [1, 2, 3] F(t, v) Print(t, v[0])
Question 10
Multiple Choice
What is the output of the following piece of code? #mod1 Def change(a) : B=[x*2 for x in a] Print(b) #mod2 Def change(a) : B=[x*x for x in a] Print(b) From mod1 import change From mod2 import change #mains=[1,2,3] Change(s)
Question 11
Multiple Choice
Which of these is not a core data type?
Question 12
Multiple Choice
Which of the following formatting options can be used in order to add „n? blank spaces after a given string „S??
Question 13
Multiple Choice
What is the output of the following program? Data = [2, 3, 9] Temp = [[x for x in[data]] For x in range(3) ] Print (temp)
Question 14
Multiple Choice
What is the output of the following program : Print 'abcefd'.replace('cd', '12')
Question 15
Multiple Choice
Which function overloads the >> operator?
Question 16
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 17
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 18
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 19
Multiple Choice
What is the output of the following program : Print 'cd'.partition('cd')
Question 20
Multiple Choice
Suppose t = (1, 2, 4, 3) , which of the following is incorrect?
showing 1 - 20 of 48
Prev
Next
Prev
1
2
3
Next
Related Exams
Previous slide
Next slide
Access For Free