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

What will be the output of the following Python code?

def f(x):
    def f1(a, b):
        print("hello")
        if b==0:
            print("NO")
            return
        return f(a, b)
    return f1
@f
def f(a, b):
    return a%b
f(4,0)

2 / 60

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

3 / 60

What is the output of this expression, 3*1**3?

4 / 60

What will be the output of the following Python code?

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

5 / 60

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

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

6 / 60

What will be the output of the following Python code?

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

7 / 60

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

 

c

 

8 / 60

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

x<<2

 

9 / 60

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

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

10 / 60

The expression shown below results in an error.

print("-%5d0",989)

a) True
b) False

11 / 60

What will be the output of the following Python code?

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

 

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

13 / 60

What will be the output of the following Python code?

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

14 / 60

Who developed Python Programming Language?

15 / 60

‘Bit’ stands for

16 / 60

What will be the output of the following Python code?

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

17 / 60

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

f = foo()
format(f)

 

18 / 60

What will be the output of the following Python expression?

4^12

19 / 60

Which of the following is a feature of Python DocString?

20 / 60

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

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

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

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

23 / 60

A computer software comprises of ___________ software & ___________ software

24 / 60

What will be the output of the following Python code?

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

25 / 60

What will be the output of the following Python expression if x=15 and y=12?

x & y

 

26 / 60

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

27 / 60

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

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

 

28 / 60

What does 3 ^ 4 evaluate to?

29 / 60

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

30 / 60

The one’s complement of 110010101 is:

31 / 60

Operators with the same precedence are evaluated in which manner?

32 / 60

What will be the output of the following Python program?

z=set('abc')
z.add('san')
z.update(set(['p', 'q']))
z

 

33 / 60

Is Python case sensitive when dealing with identifiers?

34 / 60

Python was created in what year

35 / 60

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

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

36 / 60

What are the two main types of functions in Python?

37 / 60

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

x<<2

 

38 / 60

What will be the output of the following Python code?

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

 

39 / 60

What will be the output of the following Python code?

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

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

40 / 60

It is not possible for the two’s complement value to be equal to the original value in any case.

 

41 / 60

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

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

42 / 60

The correct sequence of the history of modern era is

43 / 60

The following python code can work with ____ parameters.

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

 

 

44 / 60

Is Python case sensitive when dealing with identifiers?

45 / 60

The following is true about python except

46 / 60

What will be the output of the following Python code?

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

47 / 60

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

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

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

50 / 60

What will be the output of the following Python code?

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

51 / 60

The following are python reserved words excerpt

52 / 60

What will be the output of the following Python code?

True = False
while True:
    print(True)
    break

53 / 60

What will be the output of the following Python function?

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

 

54 / 60

What will be the output of the following Python expression?

~100?

55 / 60

Which one of the following has the same precedence level?

56 / 60

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

57 / 60

Select all options that print.

hello-how-are-you

 

58 / 60

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

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

 

59 / 60

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

print("-%06d"%X)

 

60 / 60

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

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.