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 is an invalid variable?

2 / 60

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

3 / 60

Which of the following is incorrect?

4 / 60

What will be the output of the following Python code?

def mk(x):
    def mk1():
        print("Decorated")
        x()
    return mk1
def mk2():
    print("Ordinary")
p = mk(mk2)
p()

5 / 60

Is Python case sensitive when dealing with identifiers?

6 / 60

What is the value of the following expression?

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

7 / 60

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

8 / 60

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

x = int(43.55+2/2)

9 / 60

What will be the output of the following Python code?

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

 

10 / 60

What will be the output of the following Python code?

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

 

11 / 60

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

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

 

12 / 60

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

13 / 60

What will be the output of the following Python code?

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

14 / 60

Which of the following is an invalid statement?

15 / 60

Which of the following cannot be a variable?

16 / 60

What is the average value of the following Python code snippet?

“`grade1 = 80“`

“`grade2 = 90“`

“`average = (grade1 + grade2) / 2“`

17 / 60

The following python program can work with ____ parameters.

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

 

18 / 60

Which is the correct operator for power(xy)?

19 / 60

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

20 / 60

What is the return value of trunc()?

21 / 60

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

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

22 / 60

What will be the output of the following Python expression?

round(4.576)

 

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

24 / 60

Which of the following is invalid?

25 / 60

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

print(“%06d”%X)

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

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

28 / 60

What will be the output of the following Python code?

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

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

 

30 / 60

The output of the two codes shown below is the same.

i. bin((2**16)-1)
ii. '{}'.format(bin((2**16)-1))

31 / 60

What will be the output of the following Python expression?

~100?

32 / 60

What will be the output of the following Python code?

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

 

33 / 60

Which of the following is a feature of Python DocString?

34 / 60

Which type of Programming does Python support?

35 / 60

What will be the output of the following Python code?

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

36 / 60

Which of the following is not a keyword?

37 / 60

What will be the output of the following Python code?

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

38 / 60

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

print(“%f”%x)

 

 

39 / 60

Which one of these is floor division?

40 / 60

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

x & y

 

41 / 60

Which of the following will run without errors?

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

 

43 / 60

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

print("%-06d"%x)

 

44 / 60

What will be the output of the following Python code?

d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
    print(d[x])

45 / 60

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

46 / 60

What will be the output of the following Python code?

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

47 / 60

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

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

48 / 60

The ______ symbol along with the name of the decorator function can be placed above the definition of the function to be decorated works as an alternate way for decorating a function.

 

49 / 60

What will be the output of the following Python code?

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

 

50 / 60

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

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

51 / 60

What does 3 ^ 4 evaluate to?

52 / 60

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

print("-%06d"%X)

 

53 / 60

What is the average value of the following Python code snippet?

  1. >>>grade1 = 80
  2. >>>grade2 = 90
  3. >>>average = (grade1 + grade2) / 2

54 / 60

What will be the output of the following Python code?

s='%s, %s & %s'
s%('mumbai', 'kolkata', 'delhi')

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

56 / 60

The following are high-level languages except

57 / 60

Which of the following expressions results in an error?

58 / 60

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

59 / 60

What will be the output of the following Python expression?

4^12

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

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.