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 snippet?

bool(False)
bool()

I

   True 
   True
II
   False
   True

III

   False
   False

IV

   True
   False

Which of I-IV is correct?

2 / 60

What will be the output of the following Python code?

s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')

 

3 / 60

What will be the output of the following Python code?

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

4 / 60

What will be the output of the following Python code?

True = False
while True:
    print(True)
    break

5 / 60

What will be the output of the following Python code?

def foo():
    try:
        return 1
    finally:
        return 2
k = foo()
print(k)

 

6 / 60

What will be the output of the following Python code?

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

 

7 / 60

What will be the output of the following Python code?

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

8 / 60

What is the value of the following expression?

8/4/2, 8/(4/2)

 

9 / 60

What will be the value of the following Python expression?

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

10 / 60

What data type is the object below?

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

11 / 60

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

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

a) 4 3 2 1
b) error
c) 1 2 3 4
d) none of the mentioned

12 / 60

What will be the output of the following Python code?

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

 

13 / 60

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

“`grade1 = 80“`

“`grade2 = 90“`

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

14 / 60

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

15 / 60

What will be the output of the following Python code?

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

16 / 60

What will be the output of the following Python code?

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

 

17 / 60

Which of the following is a feature of Python DocString?

18 / 60

What will be the value of the following Python expression?

4 + 3 % 5

 

19 / 60

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

 

20 / 60

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

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

21 / 60

Machines developed in mechanical era include the following except

22 / 60

What will be the output of the following Python code?

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

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

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

25 / 60

The one’s complement of 110010101 is:

26 / 60

What will be the output of the following Python code?

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

 

27 / 60

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

print(“%06d”%X)

28 / 60

What is the order of precedence in python?

29 / 60

The outcome of a programming activity is a _________

30 / 60

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

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

 

31 / 60

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

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

 

32 / 60

What will be the output of the following Python program?

i = 0
while i < 5:
    print(i)
    i += 1
    if i == 3:
        break
else:
    print(0)

33 / 60

What will be the output of the following Python code?

 D=dict(p='san', q='foundry')
'{p}{q}'.format(**D)

 

34 / 60

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

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

35 / 60

What will be the output of the following Python code?

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

36 / 60

The expression 2**2**3 is evaluates as: (2**2)**3.

37 / 60

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

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

38 / 60

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

39 / 60

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

[] or {}
{} or []

 

40 / 60

What will be the output of the following Python code?

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

 

41 / 60

What will be the output of the following Python code?

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

 

42 / 60

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

43 / 60

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

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

45 / 60

What is the return value of trunc()?

46 / 60

What arithmetic operators cannot be used with strings in Python?

47 / 60

Python was created in what year

48 / 60

What are the values of the following Python expressions?

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

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

“` 2**3**2“`

49 / 60

What will be the output of the following Python expression?

bin(29)

 

50 / 60

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

51 / 60

Which of the following is the truncation division operator in Python?

52 / 60

What will be the output of the following Python code?

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

53 / 60

Which one of these is floor division?

54 / 60

What will be the output of the following Python code?

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

 

55 / 60

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

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

56 / 60

Who developed Python Programming Language?

57 / 60

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

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

59 / 60

Select all options that print.

hello-how-are-you

 

60 / 60

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

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.