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

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

2 / 60

Which one of the following has the same precedence level?

3 / 60

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

f = foo()
format(f)

 

4 / 60

What will be the output of the following Python code?

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

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

6 / 60

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

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

8 / 60

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

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

9 / 60

Which of the following is not a core data type in Python programming?

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

 

11 / 60

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

x>>2

 

12 / 60

Which of the following is the correct extension of the Python file?

13 / 60

What will be the output of the following Python code?

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

14 / 60

What is the return type of function id?

15 / 60

The following are program elements except

16 / 60

What will be the output of the following Python code?

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

 

17 / 60

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

18 / 60

Operators with the same precedence are evaluated in which manner?

19 / 60

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

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

 

20 / 60

What will be the output of the following Python code?

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

 

21 / 60

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

print("-%06d"%X)

 

22 / 60

What will be the output of the following Python code?

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

 

23 / 60

What are the values of the following Python expressions?

“` 2**(3**2)“`

“` (2**3)**2“`

“` 2**3**2“`

24 / 60

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

25 / 60

Which of the following is an invalid variable?

26 / 60

Which of these is the definition for packages in Python?

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

28 / 60

Machines developed in transistor era include the following except

29 / 60

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

 

c

 

30 / 60

Which of the following functions can help us to find the version of python that we are currently working on?

31 / 60

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

32 / 60

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

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

33 / 60

The outcome of a programming activity is a _________

34 / 60

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

35 / 60

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

x<<2

 

36 / 60

What data type is the object below?

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

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

38 / 60

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

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

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

What will be the output of the following Python code?

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

41 / 60

Which type of Programming does Python support?

42 / 60

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

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

 

43 / 60

What will be the output of the following Python code?

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

44 / 60

A computer software comprises of ___________ software & ___________ software

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

46 / 60

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

47 / 60

What will be the output of the following Python code?

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

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

49 / 60

What will be the output of the following Python code?

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

50 / 60

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

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

 

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

 

52 / 60

Is Python code compiled or interpreted?

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

54 / 60

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

 

55 / 60

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

56 / 60

What will be the output of the following Python code?

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

57 / 60

Which of the following is incorrect?

58 / 60

What will be the output of the following Python function?

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

 

59 / 60

What will be the output of the following Python statement?

  1. >>>"a"+bc

 

60 / 60

Machines developed in mechanical era include the following except

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.