Connect with us

ACADEMICS

OAU CSC 201 Practice Quiz

Published

on

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

Which of the following is the truncation division operator?

2 / 60

What are the values of the following Python expressions?

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

 

3 / 60

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

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

4 / 60

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

5 / 60

The process of pickling in Python includes ____________

Pickling is the process of serializing a Python object, that is, conversion of a Python object hierarchy into a byte stream. The reverse of this process is known as unpickling.

6 / 60

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

7 / 60

What will be the output of the following Python code?

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

8 / 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)

9 / 60

What will be the output of the following two codes?

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

10 / 60

The following are high-level languages except

11 / 60

Operators with the same precedence are evaluated in which manner?

12 / 60

Which function is called when the following Python program is executed?

f = foo()
format(f)

 

13 / 60

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

14 / 60

The expression

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

15 / 60

What will be the output of the following Python code?

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

16 / 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?

17 / 60

The following python program can work with ____ parameters.

def f(x):
    def f1(*args, **kwargs):
           print("9jabaz")
           return x(*args, **kwargs)
    return f1

 

18 / 60

What will be the output of the following Python code?

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

 

19 / 60

What will be the output of the following Python expression?

int(1011)?

20 / 60

What is the output of print 0.1 + 0.2 == 0.3?

21 / 60

What arithmetic operators cannot be used with strings in Python?

22 / 60

Which of the following expressions results in an error?

23 / 60

What will be the output of the following Python code?

class A:
    @staticmethod
    def a(x):
        print(x)
A.a(100)

 

24 / 60

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

x>>2

 

25 / 60

What will be the output of the following Python code?

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

26 / 60

The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.

27 / 60

A function with parameters cannot be decorated.

28 / 60

Which of the following represents the bitwise XOR operator?

29 / 60

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

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

30 / 60

What is the return type of function id?

31 / 60

Which of the following is an invalid variable?

32 / 60

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

33 / 60

What is the return value of trunc()?

34 / 60

The expression 2**2**3 is evaluates as: (2**2)**3.

35 / 60

What is the order of namespaces in which Python looks for an identifier?

36 / 60

Which of the following formatting options can be used in order to add ‘n’ blank spaces after a given string ‘S’?

 

c

 

37 / 60

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

x = 2
for i in range(x):
    x += 1
    print (x)

 

38 / 60

What will be the output of the following Python code?

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

 

39 / 60

The expression shown below results in an error.

print("-%5d0",989)

a) True
b) False

40 / 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()

41 / 60

What will be the output of the following Python expression if x=456?

print("%-06d"%x)

 

42 / 60

What will be the output of the following Python expression?

round(4.576)

 

43 / 60

What will be the output of the following Python expression?

print(4.00/(2.0+2.0))

 

44 / 60

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

for i in [1, 2, 3, 4][::-1]:
    print(i, end=' ')

45 / 60

What will be the output of the following Python expression if x=56.236?

print("%.2f"%x)

46 / 60

What are the two main types of functions in Python?

47 / 60

Which of the following is invalid?

48 / 60

Given a function that does not return any value, What value is thrown by default when executed in shell.

49 / 60

Which of the following expressions involves coercion when evaluated in Python?

50 / 60

What will be the output of the following Python code?

t = '%(a)s, %(b)s, %(c)s'
t % dict(a='hello', b='world', c='universe')

51 / 60

What will be the output of the following Python code?

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

52 / 60

Which of the following is not a complex number?

53 / 60

What will be the output of the following Python code?

def ordi():
	print("Ordinary")
ordi
ordi()

 

54 / 60

What will be the output of the following Python code?

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

55 / 60

What data type is the object below?

L = [1, 23, ‘hello’, 1]

56 / 60

What will be the output of the following Python code?

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

57 / 60

What does pip stand for python?

58 / 60

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

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

59 / 60

What will be the value of the following Python expression?

float(4+int(2.39)%2)

 

60 / 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)

 

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.