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

Which of the following cannot be a variable?

2 / 60

Which of the following is incorrect?

3 / 60

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

x = 2
for i in range(x):
    x -= 2
    print (x)

4 / 60

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

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

5 / 60

Which of the following expressions results in an error?

6 / 60

Which of the following is used to define a block of code in Python language?

7 / 60

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

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

 

8 / 60

What is the value of the following expression?

2+4.00, 2**4.0

 

9 / 60

What will be the output of the following Python code?

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

10 / 60

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

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

11 / 60

The formatting method {1:<10} represents the ___________ positional argument, _________ justified in a 10 character wide field.

12 / 60

What will be the output of the following Python code?

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

 

13 / 60

Application software includes the following except

14 / 60

What will be the output of the following Python code?

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

15 / 60

What will be the output of the following Python code?

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

16 / 60

What will be the output of the following Python code?

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

 

17 / 60

What does pip stand for python?

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

19 / 60

The outcome of a programming activity is a _________

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

 

21 / 60

What are the two main types of functions in Python?

22 / 60

What will be the output of the following Python expression?

round(4.576)

 

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

24 / 60

What will be the output of the following Python code?

hex(255), int('FF', 16), 0xFF

25 / 60

What will be the output of the following Python code?

'%.2f%s' % (1.2345, 99)

26 / 60

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

f = foo()
format(f)

 

27 / 60

What will be the output of the following Python code?

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

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

28 / 60

What is the value of the following expression?

8/4/2, 8/(4/2)

 

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

30 / 60

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

z=set('abc$de')
'a' in z

 

31 / 60

Which of the following expressions can be used to multiply a given number ‘a’ by 4?

8.

32 / 60

What does 3 ^ 4 evaluate to?

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

34 / 60

What will be the output of the following Python code?

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

35 / 60

Which of the following Boolean expressions is not logically equivalent to the other three?

 

36 / 60

Who developed Python Programming Language?

37 / 60

What will be the output of the python code shown below for various styles of format specifiers?

x=1234
res='integers:...%d...%-6d...%06d' %(x, x, x)
res

38 / 60

‘Bit’ stands for

39 / 60

Any odd number on being AND-ed with ________ always gives 1. Hint: Any even number on being AND-ed with this value always gives 0.
a) 10
b) 2
c) 1
d) 0

40 / 60

What will be the output of the following Python code?

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

 

41 / 60

Which of the following expressions results in an error?

42 / 60

What will be the output of the following Python code?

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

43 / 60

Mathematical operations can be performed on a string.

44 / 60

What will be the output of the following Python code?

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

45 / 60

What will be the output of the following Python code?

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

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

 

47 / 60

Which of the following statements is used to create an empty set in Python?

48 / 60

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

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

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

50 / 60

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

51 / 60

What will be the output of the following Python code?

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

 

52 / 60

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

53 / 60

Which of the following Python statements will result in the output: 6?

A = [[1, 2, 3],
     [4, 5, 6],
     [7, 8, 9]]

 

54 / 60

What will be the output of the following Python expression?

print(4.00/(2.0+2.0))

 

55 / 60

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

56 / 60

What is the value of the following Python expression?

bin(0x8)

57 / 60

A computer software comprises of ___________ software & ___________ software

58 / 60

What will be the output of the following Python code?

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

59 / 60

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

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.