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

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

2 / 60

Which of the following cannot be a variable?

3 / 60

Which is the correct operator for power(xy)?

4 / 60

Which of the following is a feature of Python DocString?

5 / 60

In flow charts, a terminal is represented with what shape

6 / 60

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

7 / 60

What will be the output of the following Python code?

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

8 / 60

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

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

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

10 / 60

Which of the following represents the bitwise XOR operator?

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

12 / 60

The following are high-level languages except

13 / 60

The ______ is the brain of the computer that performs simple arithmetic & logical operations

14 / 60

What will be the output of the following Python function?

len(["hello",2, 4, 6])

a) Error
b) 6
c) 4
d) 3

15 / 60

What will be the output of the following Python code?

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

16 / 60

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

17 / 60

Which keyword is used for function in Python language?

18 / 60

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

19 / 60

Operators with the same precedence are evaluated in which manner?

20 / 60

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

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

21 / 60

What will be the output of the following Python code?

>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)

22 / 60

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

print(“%f”%x)

 

 

23 / 60

What are the values of the following Python expressions?

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

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

“` 2**3**2“`

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

25 / 60

What will be the output of the following Python code?

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

26 / 60

What will be the output of the following Python expression?

round(4.576)

 

27 / 60

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

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

28 / 60

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

a='hello'
q=10
vars()

 

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

30 / 60

What will be the output of the following Python expression?

print(4.00/(2.0+2.0))

 

31 / 60

What will be the output of the following Python code?

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

 

32 / 60

What will be the output of the following Python code?

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

33 / 60

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

34 / 60

What will be the output of the following Python code?

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

 

35 / 60

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

36 / 60

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

37 / 60

What will be the output of the following Python code?

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

 

38 / 60

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

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

39 / 60

What will be the output of the following Python code?

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

40 / 60

What will be the output of the following Python code?

for i in range(int(float('inf'))):
    print (i)

 

41 / 60

What will be the output of the following Python code?

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

 

42 / 60

Python was created in what year

43 / 60

What is the type of inf?

44 / 60

What are the two main types of functions in Python?

45 / 60

Which of these is the definition for packages in Python?

46 / 60

What will be the value of the following Python expression?

float(4+int(2.39)%2)

 

47 / 60

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

48 / 60

What is the order of precedence in python?

49 / 60

What will be the output of the following Python code?

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

50 / 60

The expression

“`2**2**3“` is equal to “`(2**2)**3“`

51 / 60

Which of the following is the use of id() function in python?

52 / 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.

 

53 / 60

Copy – The ______ is the brain of the computer that performs simple arithmetic & logical operations

54 / 60

Which of the following expressions involves coercion when evaluated in Python?

55 / 60

What will be the output of the following Python code?

'%.2f%s' % (1.2345, 99)

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

 

57 / 60

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

58 / 60

What is the maximum possible length of an identifier in Python?

59 / 60

Which of the following Boolean expressions is not logically equivalent to the other three?

 

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

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.