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 represents the bitwise XOR operator?

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

3 / 60

What will be the output of the following Python code?

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

4 / 60

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

print("%-06d"%x)

 

5 / 60

Which of the following is an invalid statement?

6 / 60

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

x<<2

 

7 / 60

What will be the output of the following Python code?

x = [[0], [1]]
print((' '.join(list(map(str, x))),))

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

9 / 60

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

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

 

10 / 60

What will be the output of the following Python code?

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

11 / 60

What will be the output of the following Python code?

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

12 / 60

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

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

13 / 60

What is the return value of trunc()?

14 / 60

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

15 / 60

The following python code can work with ____ parameters.

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

 

 

16 / 60

What will be the output of the following Python code?

True = False
while True:
    print(True)
    break

17 / 60

What will be the value of the following Python expression?

4 + 3 % 5

 

18 / 60

What will be the output of the following Python code?

print('*', "abcde".center(6), '*', sep='')

 

19 / 60

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

20 / 60

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

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

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

 

22 / 60

Which of the following is invalid?

23 / 60

What is the type of inf?

24 / 60

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

25 / 60

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

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

26 / 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 = " ")

27 / 60

Which of the following is incorrect?

28 / 60

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

29 / 60

What are the two main types of functions in Python?

30 / 60

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

31 / 60

What will be the output of the following Python code?

  1. class tester:
  2.     def __init__(self, id):
  3.         self.id = str(id)
  4.         id="224"
  5. 
    
  6. >>>temp = tester(12)
  7. >>>print(temp.id)

a)

32 / 60

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

33 / 60

What will be the output of the following Python expression?

int(1011)?

34 / 60

What will be the output of the following Python code?

'The {} side {1} {2}'.format('bright', 'of', 'life')

 

35 / 60

What does ~4 evaluate to?
a) -5
b) -4
c) -3
d) +3

36 / 60

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

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

 

37 / 60

What will be the output of the following Python expression if X=345?

print(“%06d”%X)

38 / 60

What will be the output of the following Python code?

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

39 / 60

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

40 / 60

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

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

42 / 60

What does pip stand for python?

43 / 60

Which of these in not a core data type?

44 / 60

What will be the output of the following Python code?

if (9 < 0) and (0 < -9):
    print("hello")
elif (9 > 0) or False:
    print("good")
else:
    print("bad")

 

45 / 60

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

X=”hi”
print(“05d”%X)

46 / 60

What will be the output of the following Python code?

def f(x):
    def f1(*args, **kwargs):
        print("*", 5)
        x(*args, **kwargs)
        print("*", 5)
    return f1
@f
def p(m):
    p(m)
print("hello")

 

 

47 / 60

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

48 / 60

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

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

49 / 60

Which of the following is a feature of Python DocString?

50 / 60

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

51 / 60

The correct sequence of the history of modern era is

52 / 60

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

x=3.3456789
'%-6.2f | %05.2f | %+06.1f' %(x, x, x)

 

53 / 60

What will be the output of the following Python statement?

  1. >>>"a"+bc

 

54 / 60

What will be the output of the following Python code?

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

55 / 60

What will be the output of the following Python code?

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

56 / 60

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

57 / 60

What will be the output of the following Python code?

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

58 / 60

What will be the output of the following Python program?

  1. def addItem(listParam):
  2.     listParam += [1]
  3. 
    
  4. mylist = [1, 2, 3, 4]
  5. addItem(mylist)
  6. print(len(mylist))

59 / 60

What will be the output of the following Python code?

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

60 / 60

What will be the output of the following Python code?

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

 

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.