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

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

 

c

 

2 / 60

Which of the following will run without errors?

3 / 60

Which of the following functions is a built-in function in python?

4 / 60

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

5 / 60

The outcome of a programming activity is a _________

6 / 60

What will be the output of the following Python code?

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

7 / 60

Operators with the same precedence are evaluated in which manner?

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

9 / 60

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

x<<2

 

10 / 60

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

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

 

11 / 60

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

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

 

12 / 60

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

f = foo()
format(f)

 

13 / 60

What will be the output of the following Python function?

min(max(False,-3,-4), 2,7)

 

14 / 60

What will be the output of the following Python function?

len(["hello",2, 4, 6])

a) Error
b) 6
c) 4
d) 3

15 / 60

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

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

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

17 / 60

What will be the output of the following Python expression?

“`round(4.576)“`

18 / 60

Operating Systems includes the following except

19 / 60

What will be the output of the following Python code?

'{a}{b}{a}'.format(a='hello', b='world')

20 / 60

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

tom
dick
harry

 

21 / 60

What data type is the object below?

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

22 / 60

Python supports the creation of anonymous functions at runtime, using a construct called __________

23 / 60

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

24 / 60

Which of the following is a Python tuple?

25 / 60

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

26 / 60

‘Bit’ stands for

27 / 60

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

print(“%f”%x)

 

 

28 / 60

What is the answer to this expression, 22 % 3 is?

29 / 60

What will be the output of the following Python code?

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

30 / 60

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

x<<2

 

31 / 60

What is the return value of trunc()?

32 / 60

What will be the output of the following Python code?

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

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

34 / 60

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

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

35 / 60

Which of the following is invalid?

36 / 60

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

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

37 / 60

What will be the output of the following Python code?

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

38 / 60

What will be the output of the following Python code?

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

39 / 60

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

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

40 / 60

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

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

 

42 / 60

Which one of these is floor division?

43 / 60

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

x=3.3456789
'%s' %x, str(x)

 

44 / 60

What will be the output of the following Python expression?

~100?

45 / 60

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

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

46 / 60

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

47 / 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])

48 / 60

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

for i in '':
    print (i)

49 / 60

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

print("%.2f"%x)

 

 

50 / 60

What will be the output of the following Python code?

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

 

51 / 60

Which of the following cannot be a variable?

52 / 60

What does 3 ^ 4 evaluate to?

53 / 60

What is the value of the following expression?

2+4.00, 2**4.0

 

54 / 60

What is the order of precedence in python?

55 / 60

What will be the output of the following Python code?

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

56 / 60

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

57 / 60

What will be the output of the following Python code?

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

 

58 / 60

What will be the value of the following Python expression?

float(4+int(2.39)%2)

 

59 / 60

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

x>>2

 

60 / 60

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

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

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.