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 the following Python expression?

4+2**5//10

2 / 60

What will be the output of the following two codes?

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

3 / 60

What will be the output of the following Python code?

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

 

4 / 60

Which keyword is used to call a function in Python language?

5 / 60

What will be the output of the following Python code?

x = 123
for i in x:
    print(i)

 

6 / 60

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

print("%-06d"%x)

 

7 / 60

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

8 / 60

Identify the decorator in the snippet of code shown below.

def sf():
     pass
sf = mk(sf)
@f
def sf():
     return

9 / 60

What will be the output of the following Python code?

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

10 / 60

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

11 / 60

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

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

12 / 60

What will be the output of the following Python code?

s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')

 

13 / 60

What will be the output of the following Python code?

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

 

14 / 60

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

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

15 / 60

What will be the output of the following Python code?

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

16 / 60

The following is true about python except

17 / 60

The correct sequence of the history of modern era is

18 / 60

What will be the output of the following Python code?

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

19 / 60

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

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

20 / 60

The two snippets of the following Python codes are equivalent.

CODE 1
  @f
def f1():
        print(“Hello”)
CODE 2
  def f1():
         print(“Hello”)
f1 = f(f1)

a) True
b) False

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

 

22 / 60

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

  1. def example(a):
  2.     a = a + '2'
  3.      a = a*2
  4.     return a
  5. >>>example("hello")

23 / 60

What will be the output of the following Python expression?

24//6%3, 24//4//2

 

24 / 60

Is Python case sensitive when dealing with identifiers?

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

26 / 60

What is the result of cmp(3, 1)?

27 / 60

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

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

28 / 60

The output of which of the codes shown below will be: “There are 4 blue birds.”?

 

29 / 60

Which is the correct operator for power(xy)?

30 / 60

Select all options that print.

hello-how-are-you

 

31 / 60

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

32 / 60

What will be the output of the following Python code?

class Truth:
	pass
x=Truth()
bool(x)

33 / 60

The one’s complement of 110010101 is:

34 / 60

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

35 / 60

‘Bit’ stands for

36 / 60

Which of the following is not a keyword?

37 / 60

Which of the following operators has its associativity from right to left?

38 / 60

What will be the value of the following Python expression?

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

39 / 60

What will be the output of the following Python function?

def f(p, q):
	return p%q
f(0, 2)
f(2, 0)



                            

40 / 60

What will be the output of the following Python code?

l=list('HELLO')
p=l[0], l[-1], l[1:3]
'a={0}, b={1}, c={2}'.format(*p)

 

41 / 60

What is the two’s complement of -44?

 

42 / 60

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

x<<2

 

43 / 60

What will be the output of the following Python code?

>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)

44 / 60

Is Python code compiled or interpreted?

45 / 60

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

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

46 / 60

What will be the output of the following Python code?

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

 

47 / 60

What will be the output of the following Python code?

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

48 / 60

The following are program elements except

49 / 60

Which type of Programming does Python support?

50 / 60

What will be the output of the following Python code if a=10 and b =20?

a=10
b=20
a=a^b
b=a^b
a=a^b
print(a,b)

51 / 60

Application software includes the following except

52 / 60

Which of the following represents the bitwise XOR operator?

53 / 60

Which of the following is a Python tuple?

54 / 60

Which of the following is incorrect?

55 / 60

In order to store values in terms of key and value we use what core data type.

56 / 60

What will be the output of the following Python code?

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

57 / 60

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

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

58 / 60

In the following Python code, which function is the decorator?

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

59 / 60

What will be the output of the following Python expression?

int(1011)?

60 / 60

What will be the output of the following Python code?

print("Hello {0[0]} and {0[1]}".format(('foo', 'bin')))Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’)
b) Error
c) Hello foo and bin
d) None of the mentioned

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.