Connect with us

ACADEMICS

OAU CSC 201 Practice Quiz

Published

on

/60
3 votes, 3.3 avg
569
Created by Oluwaferanmi Akinyele

OAU CSC 201 Practice Quiz

Welcome to the CSC 201 Exam Practice Quiz! All questions are from Sanfoundry.com and have been randomized for each attempt. The quiz will be updated regularly until the exam on Saturday. Use the Full Screen button at the top right for a better experience. Keep practicing, and good luck!

1 / 60

The following is displayed by a print function call. Select all of the function calls that result in this output.

tom
dick
harry

 

2 / 60

Which of the following is the correct extension of the Python file?

3 / 60

The expression shown below results in an error.

print("-%5d0",989)

a) True
b) False

4 / 60

What will be the output of the following Python expression?

0x35 | 0x75

5 / 60

Which one of the following is the use of function in python?

6 / 60

Which among the following list of operators has the highest precedence?

“` +, -, **, %, /, <<, >>, |“`

7 / 60

What is the type of inf?

8 / 60

The ______ symbol along with the name of the decorator function can be placed above the definition of the function to be decorated works as an alternate way for decorating a function.

 

9 / 60

What will be the output of the following Python code snippet?

not(3>4)
not(1&1)

I

   True
   True

II

   True
   False

III

   False
   True

IV
   False
   False

Which of the answers from I - IV is correct?

10 / 60

What will be the output of the following Python code?

x = "abcdef"
i = "a"
while i in x:
    print(i, end = " ")

11 / 60

Which of the following results in a SyntaxError?

12 / 60

What will be the value of ‘result’ in following Python program?

list1 = [1,2,3,4]
list2 = [2,4,5,6]
list3 = [2,6,7,8]
result = list()
result.extend(i for i in list1 if i not in (list2+list3) and i not in result)
result.extend(i for i in list2 if i not in (list1+list3) and i not in result)
result.extend(i for i in list3 if i not in (list1+list2) and i not in result)

13 / 60

What are the two main types of functions in Python?

14 / 60

The outcome of a programming activity is a _________

15 / 60

What will be the value of the following Python expression?

float(4+int(2.39)%2)

 

16 / 60

What will be the output of the following Python code snippet?

x = 'abcd'
for i in range(len(x)):
    x[i].upper()
print (x)

17 / 60

What is the order of precedence in python?

18 / 60

What will be the output of the following Python expression if the value of x is 34?

print(“%f”%x)

 

 

19 / 60

Which of the following character is used to give single-line comments in Python?

20 / 60

Which type of Programming does Python support?

21 / 60

What will be the output of the following Python code?

l=list('HELLO')
'first={0[0]}, third={0[2]}'.format(l)

22 / 60

Select all options that print.

hello-how-are-you

 

23 / 60

What will be the output of the following Python code?

x = [[0], [1]]
print((' '.join(list(map(str, x))),))

24 / 60

Which one of these is floor division?

25 / 60

What will be the output of the following Python code?

'{a}, {0}, {abc}'.format(10, a=2.5, abc=[1, 2])

26 / 60

Which one of the following is the use of function in python?

27 / 60

What will be the output of the following Python code?

i = 1
while True:
    if i%3 == 0:
        break
    print(i)
 
    i + = 1

 

28 / 60

To find the decimal value of 1111, that is 15, we can use the function:

29 / 60

What error occurs when you execute the following Python code snippet?

apple = mango

 

30 / 60

Which of the following is invalid?

31 / 60

What will be the output of the following Python code?

x = 'abcd'
for i in x:
    print(i.upper())

32 / 60

The following is true about python except

33 / 60

What will be the output of the following Python code snippet if x=1?

x<<2

 

34 / 60

What will be the output of the following Python code?

>>>print (r"\nhello")

35 / 60

Bitwise _________ gives 1 if either of the bits is 1 and 0 when both of the bits are 1.

36 / 60

What arithmetic operators cannot be used with strings in Python?

37 / 60

What is the maximum possible length of an identifier in Python?

38 / 60

Which one of the following has the same precedence level?

39 / 60

What will be the output of the following Python code?

d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
    print(x)

 

40 / 60

The expression

“`2**2**3“` is equal to “`(2**2)**3“`

41 / 60

Who developed Python Programming Language?

42 / 60

What will be the output of the following Python code?

['f', 't'][bool('spam')]

a) t
b) f
c) No output
d) Error

43 / 60

What will be the output of the following Python code?

for i in range(int(float('inf'))):
    print (i)

 

44 / 60

What will be the output of the following Python code snippet?

x=3.3456789
'%f | %e | %g' %(x, x, x)

45 / 60

Evaluate the expression given below if A = 16 and B = 15.

A % B // A

a) 0.0
b) 0
c) 1.0
d) 1

46 / 60

What will be the output of the following Python code?

x = ['ab', 'cd']
for i in x:
    x.append(i.upper())
print(x)

47 / 60

What will be the output of the following Python code?

l=[1, 0, 2, 0, 'hello', '', []]
list(filter(bool, l))

48 / 60

Which one of the following has the highest precedence in the expression?

49 / 60

Which among the following list of operators has the highest precedence?

 +, -, **, %, /, <<, >>, |

50 / 60

Which one of the following is not a keyword in Python language?

51 / 60

What will be the output of the following Python code?

'{0:.2f}'.format(1.234)

52 / 60

A function with parameters cannot be decorated.

53 / 60

What will be the output of the following Python code snippet?

a='hello'
q=10
vars()

 

54 / 60

Which of the following is a Python tuple?

55 / 60

Operating Systems includes the following except

56 / 60

What will be the output of the following Python expression if X = -122?

print("-%06d"%X)

 

57 / 60

What is the result of round(0.5) – round(-0.5)?

58 / 60

Python was created in what year

59 / 60

Which of the following is a feature of Python DocString?

60 / 60

Which of the following is an invalid statement?

Your score is

The average score is 22%

0%


Discover more from 9jabaz

Subscribe to get the latest posts to your email.

Advertisement
Comments
Scroll Up

Discover more from 9jabaz

Subscribe now to keep reading and get access to the full archive.

Continue reading

..

9jabaz.