Connect with us

ACADEMICS

OAU CSC 201 Practice Quiz

Published

on

/60
3 votes, 3.3 avg
573
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

What will be the value of X in the following Python expression?

“`X = 2+9*((3*12)-8)/10“`

2 / 60

What will be the output of the following Python code?

def mk(x):
    def mk1():
        print("Decorated")
        x()
    return mk1
def mk2():
    print("Ordinary")
p = mk(mk2)
p()

3 / 60

What will be the output of the following Python code?

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

4 / 60

What is output of print(math.pow(3, 2))?

5 / 60

The output of which of the codes shown below will be: โ€œThere are 4 blue birds.โ€?

 

6 / 60

What is the return type of function id?

7 / 60

What is the average value of the following Python code snippet?

“`grade1 = 80“`

“`grade2 = 90“`

“`average = (grade1 + grade2) / 2“`

8 / 60

Which of the following formatting options can be used in order to add โ€˜nโ€™ blank spaces after a given string โ€˜Sโ€™?

 

c

 

9 / 60

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

10 / 60

Which of the following variable naming is correct

11 / 60

What will be the output of the following Python code?

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

 

12 / 60

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

13 / 60

Which of the following is an invalid statement?

14 / 60

The following are high-level languages except

15 / 60

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

'%d %s %g you' %(1, 'hello', 4.0)

16 / 60

What is the result of round(0.5) โ€“ round(-0.5)?

17 / 60

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

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

18 / 60

What will be the value of x in the following Python expression, if the result of that expression is 2?

x>>2

 

19 / 60

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

'%(qty)d more %(food)s' %{'qty':1, 'food': 'spam'}

20 / 60

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

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

Which of the following results in a SyntaxError?

23 / 60

What will be the output of the following Python code?

d = {0, 1, 2}
for x in d:
    print(x)

 

24 / 60

Machines developed in mechanical era include the following except

25 / 60

What will be the output of the following Python code?

>>>print (r"\nhello")

26 / 60

Which of the following is the use of id() function in python?

27 / 60

‘Bit’ stands for

28 / 60

6. In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed.

  1.  >>>x = 13 ? 2

objective is to make sure x has a integer value, select all that apply (python 3.xx)

29 / 60

What will be the output of the following Python code?

'{0:f}, {1:2f}, {2:05.2f}'.format(1.23456, 1.23456, 1.23456)

 

30 / 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

31 / 60

All keywords in Python are in _________

32 / 60

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

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

33 / 60

Which of the following is true for variable names in Python?

34 / 60

What will be the output of the following Python code?

for i in range(2.0):
    print(i)

 

35 / 60

What will be the output of the following Python code?

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

 

36 / 60

What will be the output of the following Python code?

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

37 / 60

Which type of Programming does Python support?

38 / 60

What will be the output of the following Python code?

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

39 / 60

Python was created in what year

40 / 60

What will be the output of the following Python code?

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

41 / 60

What will be the output of the following Python code?

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

42 / 60

What will be the value of the following Python expression?

 bin(10-2)+bin(12^4)

43 / 60

What will be the output of the following two codes?

i. '{0}'.format(4.56)
ii. '{0}'.format([4.56,])

44 / 60

Which of the following functions can help us to find the version of python that we are currently working on?

45 / 60

What is the value of the following Python expression?

bin(0x8)

46 / 60

What are the two main types of functions in Python?

47 / 60

A computer software comprises of ___________ software & ___________ software

48 / 60

A function with parameters cannot be decorated.

49 / 60

What are the values of the following Python expressions?

 2**(3**2)
 (2**3)**2
 2**3**2

 

50 / 60

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

for i in 'abcd'[::-1]:
    print (i)

51 / 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.

 

52 / 60

What will be the output of the following Python program?

i = 0
while i < 5:
    print(i)
    i += 1
    if i == 3:
        break
else:
    print(0)

53 / 60

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

bool(โ€˜Falseโ€™)
bool()

I

   True 
   True
II
   False
   True

III

   False
   False

IV

   True
   False

Which of I-IV is correct?

54 / 60

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

['hello', 'morning'][bool('')]

 

55 / 60

What will be the value of the following Python expression?

 

56 / 60

What will be the output of the following Python code?

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

57 / 60

Which of the following is incorrect?

58 / 60

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

for i in ''.join(reversed(list('abcd'))):
    print (i)

59 / 60

Which of the following is incorrect?

60 / 60

What will be the output of the following Python expression?

bin(29)

 

Your score is

The average score is 22%

0%


Discover more from 9jabaz

Subscribe to get the latest posts sent 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.