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

What is the return type of function id?

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

3 / 60

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

4 / 60

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

X=”san-foundry”
print(“%56s”,X)

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

6 / 60

Which of the following cannot be a variable?

7 / 60

A function with parameters cannot be decorated.

8 / 60

What will be the output of the following Python code?

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

9 / 60

What is the value of the following expression?

“`float(22//3+3/3)“`

10 / 60

What will be the output of the following Python code?

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

11 / 60

What will be the value of the following Python expression?

 bin(10-2)+bin(12^4)

12 / 60

Which keyword is used to call a function in Python language?

13 / 60

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

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

14 / 60

To add a new element to a list we use which Python command?

15 / 60

Which of the following is the truncation division operator?

16 / 60

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

17 / 60

Which of the following is not a complex number?

18 / 60

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

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

 

19 / 60

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

20 / 60

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

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

21 / 60

What will be the output of the following Python code?

'%s' %((1.23,),)

 

22 / 60

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

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

23 / 60

Which is the correct operator for power(xy)?

24 / 60

What will be the output of the following Python expression?

4^12

25 / 60

What will be the output of the following Python code?

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

 

26 / 60

Is Python case sensitive when dealing with identifiers?

27 / 60

‘Bit’ stands for

28 / 60

What will be the output of the following Python code?

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

29 / 60

Which of the following results in a SyntaxError?

30 / 60

What are the two main types of functions in Python?

31 / 60

What will be the value of the following Python expression?

4 + 3 % 5

 

32 / 60

What will be the output of the following Python code?

True = False
while True:
    print(True)
    break

33 / 60

What will be the value of the following Python expression?

float(4+int(2.39)%2)

 

34 / 60

What will be the output of the following Python expression?

round(4.576)

 

35 / 60

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

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

36 / 60

Which type of Programming does Python support?

37 / 60

What are the two main types of functions in Python?

38 / 60

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

x<<2

 

39 / 60

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

40 / 60

A ________ is a sequence of instructions telling the computer what to do.

41 / 60

What will be the output of the following Python code?

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

42 / 60

A computer software comprises of ___________ software & ___________ software

43 / 60

What will be the output of the following Python code?

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

44 / 60

What will be the output of the following Python code?

def ordi():
	print("Ordinary")
ordi
ordi()

 

45 / 60

Machines developed in mechanical era include the following except

46 / 60

What will be the output of the following Python code if the system date is 21st June, 2017 (Wednesday)?

[] or {}
{} or []

 

47 / 60

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

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

49 / 60

Is Python case sensitive when dealing with identifiers?

50 / 60

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

51 / 60

What will be the output of the following Python function?

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

 

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

53 / 60

Which of the following is invalid?

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?

x = 123
for i in x:
    print(i)

 

56 / 60

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

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

57 / 60

What will be the output of the following Python code?

def d(f):
    def n(*args):
        return '$' + str(f(*args))
    return n
@d
def p(a, t):
    return a + a*t 
print(p(100,0))

a) 100
b) $100
c) $0
d) 0

58 / 60

6. In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed.

  1.  >>>x = 13 ? 2

objective is to make sure x has a integer value, select all that apply (python 3.xx)

59 / 60

What will be the output of the following Python code?

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

60 / 60

The following python program can work with ____ parameters.

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

 

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.